Home|Zing|Videos|Advertise|Submit Your Startup|Contact|About
  Subscribe to StartupSquad.com's Feed

Twitter API: A developer’s darling

By Ashish Singh | September 28th, 2007 at 04:30 am ET         

Note: Time for new stuff at StartupSquad.com. From time-to-time we will now be talking about webservices, and software development. Posts in this category will have the usual startup talk part while also delving into technical details. Feel free to jump off to the next post if it gets too tech-heavy. On our side we will be doing similar technical post few times a month. Right now, we are starting off by talking about Twitter API. Post is done by Ashish Singh, who is a Software Engineer at upcoming startup Webaroo, India.

Twitter has been arguably most cloned startsups in recent times. It has the reputation of a startup that has been cloned in most languages across the globe. Amazingly simple idea, and outstanding execution have been drivers behind its success. Simplicity has helped it evolve in multi dimensions as well.

The most important factor behind twitter’s tremendous growth has been the APIs, which have been used by hackers to build multifaceted, useful and interesting applications. You can easily estimate a coarse number of “powered by twitter” apps by the fact that twitter api receives more than 10X traffic than twitter website. Certainly, APIs have helped twitter to reach every corner of web in form of various interesting applications, and the list is increasing day by day rapidly. No wonder, it has become developer’s darling.

Twitter API scores for its simplicity, ease of use, diversity, multiple data formats, and above all simple REST architecture. Since twitter was much simpler service with its veins powered by text messages, the existing RSS feeds laid a good foundation for first API set. The API is as simple as firing HTTP requests and receiving responses in any of the four formats, plain old XML, JSON, RSS and Atom. Out of these formats, RSS and Atom are most easy to use as they already have matured parsers on almost every platform being used today. But since RSS and Atom have a predefined DTD, it has a limited footprint and does not capture much information. XML and JSON provide a better and complete view, but you need to take help of third party abstractions in order to use them efficiently.

For example, twitter request for obtaining public timeline in XML is http://twitter.com/statuses/public_timeline.xml. A typical response looks like this

<status>
<created_at>Thu Sep 27 18:42:18 +0000 2007</created_at>
<id>297192592</id>
<text>i just want to know what they are doing at all times</text>
<source>im</source>
<truncated>false</truncated>
<user>
<id>8697452</id>
<name>bluecat34</name>
<screen_name>bluecat34</screen_name>
<location />
<description/> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/ 24378882/ mommy_marissa_normal.jpg</profile_image_url>
<url />
<protected>false</protected>
</user>
</status>

The same response in RSS, ATOM and JSON is like:

RSS

<item>
<title>cc_chapman: scheduled to slide into PME around 5 - can’t wait</title>
<description>cc_chapman: scheduled to slide into PME around 5 - can’t wait</description>
<pubDate>Thu, 27 Sep 2007 18:52:26 +0000</pubDate>
 <guid>http://twitter.com/cc_chapman/statuses/297208942</guid>
 <link>http://twitter.com/cc_chapman/statuses/297208942</link>
</item>

ATOM

<entry>
   <title>petestone: longest day ever</title>
   <content type=”html”>petestone: longest day ever</content>
 <id>tag:twitter.com,2007-09-27T18:53:17+00:00:http://twitter.com/petestone/ statuses/297210002</id>
   <published>2007-09-27T18:53:17+00:00</published>
   <updated>2007-09-27T18:53:17+00:00</updated>   <linktype=”text/html” href=”http://twitter.com/petestone/statuses/297210002” rel=”alternate”/>
</entry>

JSON

{”user”:{”name”:”Jessica”,”profile_image_url”:”http:\/\/s3.amazonaws.com\/ twitter_production\/profile_images\/23719302\/JeffDIcon_normal.jpg”,”description”:”", “location”:”",”url”:null,”screen_name”: “MissJess”,”id”:8610542,”protected”:false},”truncated”:false,”text”:”@limespinkles: good luck, Bestie!!”,”created_at”:”Thu Sep 27 18:54:20 +0000 2007″,”source”:”web”,”id”:297211822}

You must have realized that information conveyed by different formats varies. JSON and XML give additional info, whereas RSS and ATOM just provides the messages. Now it is upto you on which format to use. My recommendation for browser based apps is JSON, as it nicely works with javascript, and XML, in case you wish to use it on server side. RSS and ATOM are not information rich, so should be use only when your requirements are fulfilled with mere message and timestamp.

REST powered API is easy to understand and all you need is a browser to play around with it. Although Twitter seems curl territory, but i feel your browser is a good place to begin with. The APIs are nicely documented on twitter wiki and twitter fan wiki. In case you are a “flashy” developer, then start using their actionscript libraries as mentioned on twitter blog. In case you speak Java, Python, .NET, Runy on Rails, php or perl, and find HTTP/XML/JSON/ATOM/RSS too basic/cryptic/unfriendly/, then there is enough juice for you to get started with twitter APIs here.

Fraction of the complete list of existing mashups include email/blog notifications-EmailTwitter, website monitoring-MoniTwitter, server monitoring-ServerMojo, news delivery-BBC News, Manchester United News, TwitterGram, TwitterEarth, and twiddeo.

Twitter API is a useful tool to have. It has built a mature and versatile message delivery network over a period of time, which can be utilized nicely provided it is integrated with other useful services. It can deliver weather forecasts, stock quotes, new arrivals in a store, public address messages, school notices etc. Time will tell where it will head, but this is for sure that it will continue to power better and useful apps each day.

8 Responses to 'Twitter API: A developer’s darling'

Subscribe to comments with RSS or TrackBack to 'Twitter API: A developer’s darling'.

  1. on September 28th, 2007 at 6:22 am

    […] StartupSquad » Blog Archive » Twitter API: A developer’s darling Popularity: unranked [?] « Daily Journal 2007-09-27 […]

  2. on October 1st, 2007 at 3:05 pm

    As I understand Twitter messages are not broad casted to India. Is there any Twitter clone in India. I read long time ago that someone tried to clone it off. However, when I went to their site I noticed that you could create interest groups and people could subscribe to them. People would then broad cast messages for that particular group.

    I was wondering whether there was a proper twitter clone for India out there which we could use rather than just thing interest group thing.

  3. Vivek Puri said,

    on October 1st, 2007 at 7:23 pm

    Harshal,

    You should try http://smsgupshup.com/

  4. on November 1st, 2007 at 7:17 pm

    […] The reason you can do so much cool stuff with Twitter and the reason that so many mashups / hacks are coming out is that Twitter has an open API that allows developers to build apps around, much like Facebook. If you would like to learn more about it check out the Twitter API Help page. StartupSquad also has some good information about the Twitter API. […]

  5. ImCrazy said,

    on November 25th, 2007 at 6:51 pm

    Dear Friends,

    Here is the Twitter for India! - chittR (http://www.chittr.com)
    Not sure if you guys found it

    Cool stuff dudes

    thanks -

  6. on December 5th, 2007 at 1:09 am

    healer psychic medium medium psychics psychic

  7. HK said,

    on January 20th, 2008 at 5:38 am

    HI

  8. on April 30th, 2008 at 11:41 am

    […] Twitter API : A developer’s darling […]

Leave a comment

*
To prove that you're not a bot, enter this code
Anti-Spam Image