Programming Noob
Programming Noob

Reputation: 1845

How can one learn to use the twitter API?

Ok before you jump to some conclusion like I'm looking for a free lunch or something of the sort, read the description entirely.

I have experience only in making small simple apps in PHP, Java and ASP.NET. I had no idea what GET, SET etc exactly are and what REST services are. To try to use the Twitter API, I did some reading and got to know (I might be wrong here, because this is what I THINK that I know..) that you can make a GET request like this one: http://api.twitter.com/1/statuses/user_timeline.json

Using, say, cURL (I haven't tried it yet), and you get a JSON object returned which contains the statuses on your timeline in a certain format. And I verified this from here

But I don't understand how does Twitter know that it is ME and return only MY data? Where am I sending my account details?

What I want is for the use to come to my website, click a button to give my application the permission to access his/her Tweets and I do some processing in PHP and display the output. But I don't know where do I start from?

I am not asking you to give me bread, I'm asking you to tell me what should I do to learn to fish?

All tutorial I have been following till now have been sort of spoon fed where they say things like 'Download this php file from our site, include it in your source file, use this method to do this and that method to do that.'

This one is a change for me, so does anyone have any pointers? Is there any reading that I should do or approach that I must follow to learn that I'm doing wrong?

EDIT : I know there are 3rd party libraries out there and it might be easier to learn to use those, but I want to have an idea of how the people who made those did it.

Upvotes: 0

Views: 330

Answers (1)

air-dex
air-dex

Reputation: 4178

To use Twitter (at least its REST API), you had better to read tutorials about the following things :

  • REST architecture because it is how Twitter communicates with your application.
  • HTTP requests. Useful for Authentication of requests (HTTP headers), kinds of HTTP requests (GET and POST for the Twitter API) and return codes of requests.
  • OAuth which is the protocol used by Twitter for authenticating requests.
  • Format of datas returned by Twitter after the requests. Most of the time it is JSON but it can also be like in a URL query string (for OAuth authentications). You are lucky because before there were XML and Atom (for RSS feeds) too.
  • And of course the Twitter Documentation to know how they use all that stuff, how they know that is YOU with THIS application (request authentications) and to know the objects manipulated by the API (mainly tweets, users and timelines).

Good luck for it !

Upvotes: 1

Related Questions