Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Net-Twitter CPAN distribution.

Report information
The Basics
Id: 74050
Status: resolved
Priority: 0/
Queue: Net-Twitter

People
Owner: Nobody in particular
Requestors: dan.bolser [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 3.18001
Fixed in: (no value)



Subject: 500 read failed, not sure what's wrong...
I wrote a little script like this: https://github.com/dbolser/TwitterBot---nowlistening-Perl-script-for- xmms/blob/master/twitter.pl I registered my app, and filled in the provided consumer_key and the consumer_secret in the script. When I run the script, however, I just get the following error: ./twitter.pl test TWEETING : 'test' GET https://api.twitter.com/oauth/request_token failed: 500 read failed: at ./twitter.pl line 44 I'm not sure what I'm doing wrong... When I view my app in twitter, it gives me an access_token and an access_token_secret. If I use those in the script, it works (it tweets), but users of my script don't have access to that page. My LWP version is 6.03 Cheers, Dan.
On Mon Jan 16 18:32:13 2012, dan.bolser wrote: Show quoted text
> > I'm not sure what I'm doing wrong... > > When I view my app in twitter, it gives me an access_token and an > access_token_secret. If I use those in the script, it works (it tweets), > but users of my script don't have access to that page.
You must have access tokens. The consumer_key/consumer_secret identify the application. The access_token/access_token_secret identify the Twitter user. Without both, you can't tweet. I'm not sure how you're getting the 500 error. If I plug in valid consumer key and secret, the script displays a URL. If I visit that URL in the browser, I get the expected authorization page. When I athorize, I get a PIN number. I enter the PIN number, the script prints out my access tokens and exits. If I comment out the exit line, it updates my twitter status: https://twitter.com/#!/semifor_test/status/159061108899069952 When you distribute the script, you either need to distribute it with instructions for users to obtain their own consumer key/secret and access token/secret, or... ...distribute it with your consumer key/secret with a script and instructions for users to obtain their access tokens. Save the access tokens so the script can use them on subsequent runs. NOTE: Twitter frowns on this. They prefer you have user register their own app. If you choose to distribute your consumer key/secret, you should obfuscate them so it is not obvious what they are. Twitter has been known to deauthorize applications that share their consumer credentials. This isn't a bug in Net::Twitter. Your script, and Net::Twitter work when the required access tokens are there.
From: dan.bolser [...] gmail.com
On Mon Jan 16 18:32:13 2012, dan.bolser wrote: Show quoted text
> I wrote a little script like this: > > https://github.com/dbolser/TwitterBot---nowlistening-Perl-script-for- > xmms/blob/master/twitter.pl > > > I registered my app, and filled in the provided consumer_key and the > consumer_secret in the script. When I run the script, however, I just > get the following error: > > ./twitter.pl test > TWEETING : 'test' > > GET https://api.twitter.com/oauth/request_token failed: 500 read
failed: Show quoted text
> at ./twitter.pl line 44 > > > I'm not sure what I'm doing wrong... > > When I view my app in twitter, it gives me an access_token and an > access_token_secret. If I use those in the script, it works (it
tweets), Show quoted text
> but users of my script don't have access to that page. > > > My LWP version is 6.03
I just updated LWP::Protocol::https, and it now works! grep -i version ../perl5/lib/perl5/LWP/Protocol.pm $VERSION = "6.00"; grep VERSION ../perl5/lib/perl5/LWP/Protocol/https.pm our $VERSION = "6.02"; Show quoted text
> Cheers, > Dan. >
Subject: Re: [rt.cpan.org #74050] 500 read failed, not sure what's wrong...
Date: Tue, 17 Jan 2012 00:07:04 +0000
To: bug-Net-Twitter [...] rt.cpan.org
From: Dan Bolser <dan.bolser [...] gmail.com>
Yes, it's a dependency bug. On 17 January 2012 00:03, Marc Mims via RT <bug-Net-Twitter@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=74050 > > > On Mon Jan 16 18:32:13 2012, dan.bolser wrote:
>> >> I'm not sure what I'm doing wrong... >> >> When I view my app in twitter, it gives me an access_token and an >> access_token_secret. If I use those in the script, it works (it tweets), >> but users of my script don't have access to that page.
> > You must have access tokens.  The consumer_key/consumer_secret identify > the application.  The access_token/access_token_secret identify the > Twitter user.  Without both, you can't tweet. > > I'm not sure how you're getting the 500 error. If I plug in valid > consumer key and secret, the script displays a URL.  If I visit that URL > in the browser, I get the expected authorization page.  When I athorize, > I get a PIN number.  I enter the PIN number, the script prints out my > access tokens and exits. > > If I comment out the exit line, it updates my twitter status: > https://twitter.com/#!/semifor_test/status/159061108899069952 > > When you distribute the script, you either need to distribute it with > instructions for users to obtain their own consumer key/secret and > access token/secret, or... > >  ...distribute it with your consumer key/secret with a script and > instructions for users to obtain their access tokens.  Save the access > tokens so the script can use them on subsequent runs.  NOTE: Twitter > frowns on this. They prefer you have user register their own app.  If > you choose to distribute your consumer key/secret, you should obfuscate > them so it is not obvious what they are.  Twitter has been known to > deauthorize applications that share their consumer credentials. > > This isn't a bug in Net::Twitter.  Your script, and Net::Twitter work > when the required access tokens are there. > >