Wednesday, 26th August, 2009
Twitter Replies
So I was coding Java, and Python and C# the other day. But all for a good cause!
Twitterfall has gone live with their replies API. Basically, if you know the JSON you can lookup the replies to any* tweet that you know the tweet ID of. Also there’s a streaming one, so you can watch for replies to any* known tweet ID. And you can find the top most replied tweets (upto 20).
But obviously, you’ve got to get the data and then mess around with JSON strings. So I wrote a Python API wrapper. Then a Java And finally a C#.
Quick run down:
Python : Quick, Easy, had a JSON and a HTTP connection handler build into the std. library
Java: Slow, difficult, pernickety. Had stuff for playing with HTTP connections but not JSON.
C#: Quick, Easy under Mono, JSON libs were a breeze to install. Under .Net, WebResponse and HttpWebResponse objects were TERRIBLE. After one usage they started throwing System.Net.ProtocolViolationExceptions.
Lesson: If you’re going to develop anything, Avoid Java, Python is easiest and C# is ok, but only under Mono/Linux. I would’ve thought the reverse should be true for C#, you know, what with it being a Microsoft product.
Done! :-D
* Twitterfall does not have the firehose; so they have an incomplete dataset.