How to develop a twitter application through twitter API

August 8, 2009 at 9:25 am 8 comments

Since, twitter has changed the world of Internet and of course it has given a new way of application development. Now you can easily develop an application for twitter and use twitter’s user base to promote your application. Since twitter has great traffic ,you can easily take the advantage of it. The best examples of this are twitpic, twitsnaps, digsby,twitterfeed,twhirl etc. To develop a killer twitter application you need two things essentially.

1)A unique idea

2)Twitter’s API :)

So idea is yours and API is of twitter, and I tell you how to use it.

Twitter has two kinds of APIs.

1)Non Oauth

2)Ouath

Before discussing on APIs, I just explain you first what is Oauth. Oauth is basically an open protocol to allow secure API authorization in a simple and standard method from desktop and web applications.Oauth came in existence in 2006 and twitter adopted this in the early of 2009. Previously twitter has non oauth APIs. Most of the famous twitter applications are developed in this. You can use this for such APIsĀ  http://uurl.in/Haw2i

In Non Oauth APIs you directly need the user information like userid,password to access the features. If you are using such APIs user’s twitter login credentials are in your control. You can save them. Like in case of twitpic you give your twitter userid and password to twitpic. Twitpic may save it :) .Such APIs need user’s exact userid and password to access them properly.

In Oauth APIs you need an authentication token that will be given from twitter only. For such applications you will have to register yourself with twitter. After registration,twitter will give you a Consumer Key and Consumer Secret Key. That you need to use in your source code. In these applications an authentification url is given by twitter to login. When user clicks on that login url , it takes user to twitter where user has to enter his userid and password, if it successful then twitter redirects it to your callback URL (url of your application,that you define when you register with twitter) along with a unique oauth token. On the basis of that token you can use the API to access its features. This is considerd as secure from user’s point of view because user’s login information is secure and you can not catch it.

Now most of the users prefer oauth based applications. But still twitter’s Oauth API is not as good as its Non Oauth API for desktop or mobile applications.Since they are improving this.

You can register your application for Oauth from http://twitter.com/oauth_clients

And the help is available on http://apiwiki.twitter.com/OAuth-FAQ

To know about Oauth visit http://oauth.net/

Advertisement

Entry filed under: API. Tags: , , , .

What is best and economical for website development.. How to post photos in flickr through API and PHP

8 Comments Add your own

  • 1. reboltutorial.com  |  August 20, 2009 at 4:43 pm

    Thanks, I’m just starting with Twitter API. Can you tell me if it is possible to create a new account with Twitter API ?

    Reply
  • 2. srinivas tamada  |  October 21, 2009 at 12:21 pm

    Good Information

    Any tutorials

    Reply
  • 3. Manoj  |  November 14, 2009 at 12:36 am

    Hi Hitesh,

    How complex is it to integrate twitter with any mobile app?

    Reply
    • 4. Hitesh Mathpal  |  November 14, 2009 at 6:31 pm

      This is not complicated at all.You can easily use Twitter API in your J2ME,Objective C and other mobile application. For example , if you have to access my profile in your twitter app, you can hit the url http://twitter.com/users/show.xml?screen_name=hitesh84 by an HTTP call (via your J2ME or other code) it will return you an XML that you can read by DOM classes and display in your application. Twitter has REST API that takes HTTP request. Yes some of the features or methods need authentication like tweet posting etc.

      Reply
  • 5. Mithun  |  January 29, 2010 at 3:52 am

    Hello Hithesh..Nice article yaar…very explanatory. I was working on flickr apis and came across OAuth. Did not find anything so informative…Thanks a lot :)

    Reply
  • 7. sam  |  December 13, 2010 at 2:48 pm

    I need to implement twitter application to my site http://www.softnwords.com . I need unique articles to be listed and authors will be payed for every article they list it here for free.

    Reply
  • 8. Imeye  |  January 8, 2011 at 9:28 am

    The information is good but how to use the oauth to write code for twitter applications.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed



Follow

Get every new post delivered to your Inbox.