Posted on 2008-08-18 21:02:11-07 by jeunice
Net::Twitter breaks badly on some Twitter responses

When calling a Twitter API such as

http://twitter.com/statuses/friends_timeline.json?count=100

it turns out that Twitter sometimes responds with a string like:

Couldn't find Status with ID=891433567

instead of an actual JSON object.

Unfortunately this breaks the JSON::Any->jsonToObj( $req->content ) that's the punchline to most Net::Twitter methods. So while there might be 98 or 99 good status messages, Net::Twitter::friends_timeline() e.g. silently returns undef, as though no new tweets were available.

Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.