the code is what I posted above...

My goal is a simple twitterbot that tweets hourly a string I tell it
to tweet. Worked fine in the userid/password days, now it doesn't
anymore thanks to oauth. I'm not trying to have other users use the
app in their name (which is what oauth is for), i just want a simple
api call to tweet to 'my own account'. All this difficult s...@t to make
that work isn't really my cup of tea.... If you can help me make this
work, thanks a lot: so there's one script that creates the string and
puts the keys in the environment. Here's the current code of the
script that uses that info to tweet:
---------start--------------
#!/usr/bin/perl

use Net::Twitter;

$wikiurl = $ENV{iurl};
$wikitxt = $ENV{itxt};

$wikckey = $ENV{ckey};
$wikcsec = $ENV{csec};
$wikatok = $ENV{atok};
$wikasec = $ENV{asec};

#debugging:
print "keys are\n";
print "$ckey\n";
print "$csec\n";
print "$atok\n";
print "$asec\n";

my $client = Net::Twitter->new(
    traits => ['OAuth', 'API::REST'],
    consumer_key => $ckey,
    consumer_secret => $csec,
    access_token => $atok,
    access_secret => $asec,
);

binmode STDOUT, ":utf8";

$tweet = $iurl." ".$itxt;
#debugging:
print "$tweet\n";

my $res = $client->update({ status => $tweet });

print "Tweeted: 
http://twitter.com/$res->{user}{screen_name}/status/$res->{id}\n";
---------end-----------

still get 'Could not authenticate you.'

I don't get it. The keys are good as far as I can see. (i don't make
typo's with copy paste...) Interestingly, it doesn't print the last
line either...

what am I doing wrong?



On Sep 23, 8:14 am, Marc Mims <marc.m...@gmail.com> wrote:
> * wkossen <w.kos...@gmail.com> [100922 06:09]:
>
> > Added the traits bit, now I get 'Could not authenticate you.'.   help?
>
> Have you verified your credentials (consumer key/secret, access
> token/secret)?  If you can email me some code (sans credentials) I'd be
> happy to take a look at it.
>
>         -Marc

-- 
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