Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Net::Twitter - fatal , but no error?

by ultranerds (Friar)
on Feb 08, 2013 at 13:02 UTC ( #1017809=perlquestion: print w/ replies, xml ) Need Help??
ultranerds has asked for the wisdom of the Perl Monks concerning the following question:


I'm trying to get Net::Twitter to work in my admin backend. Basically (with permission) it will post on users twitter feeds when they add a listing. I have this:
use Net::Twitter; my $nt = Net::Twitter->new( traits => [qw/OAuth API::REST/], consumer_key => 'aaaaa', consumer_secret => 'xxxxx', access_token => $user->{tw_token}, access_token_secret => $user->{tw_token_secret}, ); my $result; eval { $result = $nt->update('Hello, world!'); }; if ( my $err = $@ ) { die $@; warn "HTTP Response Code: ", $err->code, "\n", "HTTP Message......: ", $err->message, "\n", "Twitter error.....: ", $err->error, "\n"; }
When I run it, I get:

<p><font face='Tahoma,Arial,Helvetica' size=2>A fatal error has occured:</font></p><blockquote><pre></pre></blockquote><p><font face='Tahoma,Arial,Helvetica' size=2>Please enable debugging in setup for more details.</font></p>

Which is of no use what-so-ever :( I know the key/secrets are ok, as I'm using those to login with. Anyone got any ideas? I've googled on the subject - but didn't come up with anything.



Comment on Net::Twitter - fatal , but no error?
Select or Download Code
Replies are listed 'Best First'.
Re: Net::Twitter - fatal , but no error?
by tobyink (Abbot) on Feb 08, 2013 at 13:22 UTC

    The key and secret are not a Twitter username+password combo; they are an OAuth pair, and will be different from what you'd use to log into the Twitter website with your browser.

    PS: have you tried enabling debugging in setup perchance?

    package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
      Thanks - I'm actually using the OAuth key/secret :) (not what I use to login on the twitter website itself)

      >>PS: have you tried enabling debugging in setup perchance?<<

      In Net::Twitter? I can't see anything about enabling debug on the Cpan POD?



        I assume the message about debugging was coming from some sort of web interface that is wrapping your code - your "admin backend"?

        package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1017809]
Front-paged by Arunbear
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2015-11-27 14:58 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (730 votes), past polls