Hello. I'm trying to tweet programmatically using the
Net::Twitter::Lite perl module. I use their example verbatim, with my
consumer_key and consumer_secret which I got by registering an app on
twitter.

When I run the script I get "Could not authenticate you." I did copy
and paste the two keys so there shouldn't be any typos.

I did search the archives for this group and, while I see postings
quite similar to mine, I couldn't find any resolutions or information
that might help me.

How can I debug this?

Here's my script:


#!/usr/bin/perl
use warnings;

use Net::Twitter::Lite;
use Scalar::Util 'blessed';

# As of 13-Aug-2010, Twitter requires OAuth for authenticated
requests  my $nt = Net::Twitter::Lite->new(
      traits   => [qw/OAuth API::REST/],
      consumer_key        => '<my consumer_key>',
      consumer_secret     => '<my_consumer_secret>',
      access_token        => $token,      access_token_secret =>
$token_secret,
  );

  my $result = $nt->update('Hello, world!');
  eval {
      my $statuses = $nt->friends_timeline({ since_id => $high_water,
count => 100 });
      for my $status ( @$statuses ) {
          print "$status->{created_at} <$status->{user}{screen_name}>
$status->{text}\n";
      }
  };
  if ( my $err = $@ ) {
      die $@ unless blessed $err && $err-
>isa('Net::Twitter::Lite::Error');

      warn "HTTP Response Code: ", $err->code, "\n",
           "HTTP Message......: ", $err->message, "\n",
           "Twitter error.....: ", $err->error, "\n";
  }

Thanks very much.

Sol

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk

Reply via email to