Thursday 31 May 2012

Directed Message

Spectrum twitter backend now allows spectrum users to send direct messages to their twitter contacts! Also, I re-organized the code a bit to make it cleaner and easier to read.

Wednesday 30 May 2012

XML Parser to Parse Twitter Responses

Twitter offers wide range response formats viz. XML, json, rss and atom to choose from. However, twitcurl, the library that spectrum-twitter backend uses to interact with Twitter, uses XML. Hence, it was necessary to have an XML parser to  parse twitter response data and send this parsed data back to the user. Luckily, Swiften, one of the libraries used by spectrum, already had the necessary code to write XML parsers. I finally (with a bit of help from my mentor;)) finished writing a basic XML parser that can parse status messages returned by twitter in XML. The user can now view his timeline:)

Tuesday 29 May 2012

Added Database Support to Store OAuth Access Token

Twitter backend uses OAuth access token to perform operations such as status update, sending directed messages etc. on behalf of the user who authorizes the app. Obtaining the OAuth access token is a three step process which is given below:
  1. When the user tries to access his twitter-account via spectrum, spectrum asks the users to visits an authorization URL that it receives by contacting twitter and asks the user to authorize spectrum. 
  2. The User visits the authorization URL to authorizes spectrum. When the user grants spectrum the requested permissions, twitter redirects the user to another page where it provides a unique number called PIN that has to be returned to the application (spectrum). 
  3. The user then returns to spectrum and gives the PIN that he/she obtained from twitter. Spectrum then exchanges this PIN for OAuth access token from twitter, which grants spectrum access to the the user's twitter account. 
In order to avoid having to go through this three step process each time the user logs in, twitter-backend stores the OAuth access token in a database and uses it directly the next time user logs in. 

Thursday 24 May 2012

Logging into Twitter and Status update

Finally pushed code for 'logging into twitter' and 'status update' via spectrum! The code as of now is in its initial stages without exception handling etc. Nevertheless, I now have a basic setup in place to proceed further :)

Saturday 19 May 2012

GSoC 2012 Coding Phase (2 days to go)

I got accepted to GSoC 2012, my first GSoC! I will be working on the spectrum project, which comes under XSF. During this summer, as a part of GSoC, I will be working on adding twitter support to spectrum! Super excited and can't wait to start off!!