Net-Twitter - Net::Twitter breaks badly on some Twitter responses

Posted on Tue Aug 19 00:02:11 2008 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.

Write a response