The first problem is that you cannot get information from Twitter freely and anonymously. System called OAuth restricts unauthorized requests to Twitter server. Twitter wants to know who,
where and when is going to get its information. One reason is definitely a security, but the second and probably more important one is Twitter’s wish to get money for its information.
If you want to post tweets on your page – pay. Of course, free possibility exists - it is called Standard account, and it provides tweets for the last 7 days with some basic search options and some
restrictions as well.
For more possibilities consider Premium subscription.
For any type of account you must provide Twtter with your phone number for it can track you down anywhere on the Earth and kill=). Being the highly privacy concerned guy I don’t like the idea
to share my contacts with shady internet sites which here and there want to get you phone number for one day using it against you or just simply selling it to spam companies. That is why it took me
days to submit to the inevitable and sell my soul to devil finally create the twitter account specifying my phone number. I consoled myself that it is a reasonable tradeoff for the possibility to
study network technologies.
Ok. Let’s return to our OAuth system. Now, with every request to Twitter server you must attach a whole bunch of information about yourself like:
Consumer Key
Consumer Secret
Access Token
Access Token Secret
Your naked photo (optional)
Etc. etc.
Consumer Key, Consumer Secret and Tokens are provided by Twitter.
That was all about first problem. The second one is after you authenticated, created the request, you cannot send it directly through Java Script (for example using GET method).
You must do it through an intermediate server (for example running Node.js). This is a completely new topic for me so I decided to put Twitter API aside until I finish JS books and
feel I am ready for Node.js. It is not a defeat; it’s just a tactical step-back.
I have found a good book about this issue –“Javascript Programming for Twitter API 1.1” and a good web site which describes how to use Boy Cook library to get
access to Twitter API http://strangemilk.com/twitter-api-with-javascript/.
So I will return to all these stuff when I am ready and now let’s continue our walk along the road to Javascript mastery.