* Paul Smith via RT <bug-Net-Twitter@rt.cpan.org> [100903 06:22]:
Show quoted text> Thanks for a great module! In the past several days I've noticed my
> API limit not decreasing but now this morning I see it's at 150. I
> tried it with another account and I see the same thing. After a data
> dump I no longer see the rate_limit_status value. Has something
> changed with the Twitter API?
>
> Is there a work around?
Are you using OAuth? Twitter turned off Basic Auth support,
permanently, on August 31st.
http://groups.google.com/group/twitter-api-announce/browse_thread/thread/c03fa2b1ae90d2a9
What you're seeing is a combination of errors and changes in the way the
Twitter API works, now. <sigh/>
Rather than sending a 401 response to inform you you cannot authenticate
with Basic Auth, Twitter is sending a 200 response with this payload:
{"errors":[{"code":32,"message":"Could not authenticate you"}]}
That error format is something that leaked into the wild in a recent
upgrade. Twitter acknowledged it as a bug and said they were going to
revert the change:
http://is.gd/eTiwv
It seems they are not actually going to revert. There is a developer
release of Net::Twitter that handles this new error format (at least
when stringifying Net::Twitter::Error objects):
http://search.cpan.org/~mmims/Net-Twitter-3.13008_01/
I'm working on a release to better address the multiple, inconsistent,
error formats Twitter now sends.
It also appears there's a bug in Net::Twitter. You should be able to
do:
$nt->rate_limit_status({ authenticate => 0 })
to suppress the authentication header and get a response for your IP
address, rather than for a specific user. However, NT is adding the
authentication header anyway when username/password exists.
If you use a completely unauthenticated NT object, you'll get a response
for your IP address. The default rate limit IP addresses that have not
been white-listed is still 150:
$nt = Net::Twitter->new;
my $r = $nt->rate_limit_status;
printf "limit: %s, remaining %s\n", @{$r}{qw/hourly_limit remaining_hits/};
# limit: 150, remaining 150
Hope that helps.
-Marc