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: 60322
Status: rejected
Priority: 0/
Queue: Net-Twitter

People
Owner: MMIMS [...] cpan.org
Requestors: olaf [...] wundersolutions.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 3.13007
Fixed in: (no value)



Subject: oauth example script returns no output
Hi, When running oauth_webapp.pl the last tweet is not being returned. Around line 65: my $status = eval { $nt->user_timeline({ count => 1 }) }; The above returns undef. my $status = eval { shift @{ $nt->user_timeline } }; The above does return something useful, but I haven't done any digging to see why the syntax in the script isn't returning anything. Not critical, but when I was trying the example it wasn't initially clear to me if the OAuth implementation wasn't working or if it was an issue with the script. Thanks for a great module! Olaf
Subject: Re: [rt.cpan.org #60322] oauth example script returns no output
Date: Thu, 26 Aug 2010 10:06:44 -0700
To: Olaf Alders via RT <bug-Net-Twitter [...] rt.cpan.org>
From: Marc Mims <marc.mims [...] gmail.com>
* Olaf Alders via RT <bug-Net-Twitter@rt.cpan.org> [100813 16:06]: Show quoted text
> When running oauth_webapp.pl the last tweet is not being returned. > Around line 65: > > my $status = eval { $nt->user_timeline({ count => 1 }) }; > > The above returns undef. > > my $status = eval { shift @{ $nt->user_timeline } }; > > The above does return something useful, but I haven't done any digging > to see why the syntax in the script isn't returning anything. > > Not critical, but when I was trying the example it wasn't initially > clear to me if the OAuth implementation wasn't working or if it was an > issue with the script.
I've re-run and examined the example script, and I'm not finding a problem with it. my $status = eval { $nt->user_timeline({ count => 1 }) }; The line above isn't returning undef. Rather, it returns an array ref with a single status element. If the user_timeline call fails, $status will be undef, however, the following block, beginning with "if ( $@ )", should handle the error condition. Can you reproduce the problem? -Marc
On Thu Aug 26 13:07:00 2010, marc.mims@gmail.com wrote: Show quoted text
> > I've re-run and examined the example script, and I'm not finding a > problem with it. > > my $status = eval { $nt->user_timeline({ count => 1 }) }; > > The line above isn't returning undef. Rather, it returns an array ref > with a single status element. > > If the user_timeline call fails, $status will be undef, however, the > following block, beginning with "if ( $@ )", should handle the error > condition > > Can you reproduce the problem?
Actually, I can, and this is the issue. I begin the script at: http://ww5.wundercounter.com:8080 I get bounced to Twitter and then Twitter sends me back to: http://mirror.urwebhost.com:8080/oauth_callback?oauth_token... The page is blank, but if I look at the command line output, I see: Handling request for /oauth_callback Use of uninitialized value in string eq at examples/oauth_webapp.pl line 108, <DATA> line 16. Something is horribly wrong at examples/oauth_webapp.pl line 108, <DATA> line 16. So, I guess if that had appeared in the actual browser output, that would have been a little more obvious, but the issue is on my end. In my case the reverse DNS for that server IP is actually mirror.urwebhost.com, which points back to the same machine. If the script used HTTP_HOST rather than SERVER_NAME, I think it would have redirected to the same URL which was originally used. olaf-alderss-macbook-pro:~ olaf$ host ww5.wundercounter.com ww5.wundercounter.com has address 64.37.82.105 olaf-alderss-macbook-pro:~ olaf$ host 64.37.82.105 105.82.37.64.in-addr.arpa domain name pointer mirror.urwebhost.com. Bad DNS setup on my part, but using HTTP_HOST might not be a bad idea if that variable is available. Olaf
I communicated with the author of HTTP::Server::Simple::CGI::Environment. HTTP_HOST is not mentioned in the CGI specification. SERVER_NAME is and should be the correct value on properly configured systems. I don't see a reasonable way to accommodate HTTP_HOST in the example scripts. Thanks for the report! -Marc