Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

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

People
Owner: Nobody in particular
Requestors: dmck [...] interactive.co.uk
Cc: dom [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.12004
Fixed in: (no value)



Subject: apiurl parameter to new() required
Date: Mon, 26 Aug 2013 18:10:33 +0100
To: bug-Net-Twitter-Lite [...] rt.cpan.org
From: David McKelvie <dmck [...] interactive.co.uk>
26 August 2013 Using Net::Twitter::Lite::WithAPIv1_1; # version 0.12004 I was getting '410 Gone' responses from Twitter on an app which had worked with Twitter v1 API. I found that my code could be made to work if I added apiurl => 'http://api.twitter.com/1.1', to my $nt = Net::Twitter::Lite::WithAPIv1_1->new( consumer_key => $consumer_key, consumer_secret => $consumer_secret, access_token => $token, access_token_secret => $token_secret, apiurl => 'http://api.twitter.com/1.1', ); Should this now be the default value for the apiurl parameter? David McKelvie
Subject: Re: [rt.cpan.org #88145] apiurl parameter to new() required
Date: Mon, 26 Aug 2013 12:13:54 -0700
To: bug-Net-Twitter-Lite [...] rt.cpan.org
From: Marc Mims <marc [...] questright.com>
On Mon, Aug 26, 2013 at 10:11 AM, dmck via RT <bug-Net-Twitter-Lite@rt.cpan.org> wrote: Show quoted text
> I was getting '410 Gone' responses from Twitter on an app which had worked with > Twitter v1 API. > > I found that my code could be made to work if I added > > apiurl => 'http://api.twitter.com/1.1', > > to > > my $nt = Net::Twitter::Lite::WithAPIv1_1->new( > consumer_key => $consumer_key, > consumer_secret => $consumer_secret, > access_token => $token, > access_token_secret => $token_secret, > apiurl => 'http://api.twitter.com/1.1', > ); > > Should this now be the default value for the apiurl parameter?
It is the default. I'm not sure how you're getting something different: $ perl -MNet::Twitter::Lite::WithAPIv1_1 -E'say Net::Twitter::Lite::WithAPIv1_1->new->{apiurl}' http://api.twitter.com/1.1 Perhaps inspect %INC and see if you're getting the Net::Twitter::Lite modules from the expected locations.
Subject: Re: [rt.cpan.org #88145] apiurl parameter to new() required
Date: Mon, 26 Aug 2013 20:52:16 +0100
To: bug-Net-Twitter-Lite [...] rt.cpan.org
From: David McKelvie <dmck [...] interactive.co.uk>
Thank you. Yes, its quite obvious that http://api.twitter.com/1.1 IS the default URL. $ perl -MNet::Twitter::Lite::WithAPIv1_1 -E'say Net::Twitter::Lite::WithAPIv1_1->new->{apiurl}' gives me 'http://api.twitter.com/1.1' as expected. Now of course, my test script (essentially the one on the CPAN website) is working without adding the apiurl parameter explicitly :-) It must have been some other change that I made that did the difference. Sorry for wasting your time and thanks for getting back to me to say 'Yes, it does work'. That is often very helpful. David
Subject: Re: [rt.cpan.org #88145] apiurl parameter to new() required
Date: Tue, 27 Aug 2013 00:39:17 +0100
To: bug-Net-Twitter-Lite [...] rt.cpan.org
From: David McKelvie <dmck [...] interactive.co.uk>
On the other hand when I embed Net::Twitter::Lite::WithAPIv1_1 inside my complicated Catalyst app <code> use Net::Twitter::Lite::WithAPIv1_1; ... my %twitter_app_tokens = twitter_app_tokens(); my $nt = Net::Twitter::Lite::WithAPIv1_1->new(%twitter_app_tokens); </code> I find I *do* have to include <code> apiurl => 'http://api.twitter.com/1.1', </code> in the output of twitter_app_tokens() All very confusing, and not much of a bug report as is, since its not reproducible. David
Subject: Re: [rt.cpan.org #88145] apiurl parameter to new() required
Date: Mon, 26 Aug 2013 18:36:41 -0700
To: bug-Net-Twitter-Lite [...] rt.cpan.org
From: Marc Mims <marc [...] questright.com>
Indeed. I'm guessing you're picking up Net::Twitter::Lite::WithAPIv1_1 from a different directory in @INC that Net::Twitter::Lite. It might be necessary to reinstall Net::Twitter::Lite wherever you web app expects it. It's also possible I've broken something in the Net::Twitter::Lite distribution in such a way some call you're relying on isn't using the correct apiurl. On Mon, Aug 26, 2013 at 4:39 PM, dmck via RT <bug-Net-Twitter-Lite@rt.cpan.org> wrote: Show quoted text
> Queue: Net-Twitter-Lite > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=88145 > > > > On the other hand when I embed Net::Twitter::Lite::WithAPIv1_1 inside my > complicated Catalyst app > > <code> > > use Net::Twitter::Lite::WithAPIv1_1; > ... > my %twitter_app_tokens = twitter_app_tokens(); > my $nt = Net::Twitter::Lite::WithAPIv1_1->new(%twitter_app_tokens); > > </code> > > I find I *do* have to include > <code> > apiurl => 'http://api.twitter.com/1.1', > </code> > in the output of twitter_app_tokens() > > All very confusing, and not much of a bug report as is, since its not > reproducible. > > David > >
Subject: Re: [rt.cpan.org #88145] apiurl parameter to new() required
Date: Tue, 27 Aug 2013 05:21:48 +0100
To: bug-Net-Twitter-Lite [...] rt.cpan.org
From: David McKelvie <dmck [...] interactive.co.uk>
Thanks again; It is as you say, my Catalyst app is picking up an older version of Net/Twitter/Lite.pm from an extra app-specific directory on the @INC. David
On Mon Aug 26 18:11:10 2013, dmck@interactive.co.uk wrote: Show quoted text
> > 26 August 2013 > > Using Net::Twitter::Lite::WithAPIv1_1; # version 0.12004 > > I was getting '410 Gone' responses from Twitter on an app which had > worked with > Twitter v1 API. > > I found that my code could be made to work if I added > > apiurl => 'http://api.twitter.com/1.1', > > to > > my $nt = Net::Twitter::Lite::WithAPIv1_1->new( > consumer_key => $consumer_key, > consumer_secret => $consumer_secret, > access_token => $token, > access_token_secret => $token_secret, > apiurl => 'http://api.twitter.com/1.1', > ); > > Should this now be the default value for the apiurl parameter?
I'm seeing this too. There are no other versions of Net::Twitter::Lite installed on @INC. Attached is a trivial test case which fails if you comment out apiurl. This is a libnet-twitter-lite-perl 0.12004-1 http://packages.debian.org/source/unstable/libnet-twitter-lite-perl running on Debian stable.
Subject: rt88145.pl
#!/usr/bin/perl use strict; use warnings; use Net::Twitter::Lite::WithAPIv1_1; use constant EX_TEMPFAIL => 75; my $nt = Net::Twitter::Lite->new( consumer_key => ', consumer_secret => '', access_token => '', access_token_secret => '', legacy_lists_api => 0, # Shouldn't be needed but apparently is # https://rt.cpan.org/Ticket/Display.html?id=88145 apiurl => 'http://api.twitter.com/1.1' ); my $text = do { local $/; <STDIN> }; eval { $nt->update($text); }; if ( my $err = $@ ) { if ($err->isa('Net::Twitter::Lite::Error')) { warn "HTTP Response Code: ", $err->code, "\n", "HTTP Message......: ", $err->message, "\n", "Twitter error.....: ", $err->error, "\n"; } else { warn $err . "\n"; } exit EX_TEMPFAIL; }