Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Net::Twitter - fatal , but no error?

by ultranerds (Pilgrim)
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:

Hi,

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.

TIA

Andy

Comment on Net::Twitter - fatal , but no error?
Select or Download Code
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?

      TIA!

      Andy

        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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2014-07-30 00:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (229 votes), past polls