Thursday 21 June 2012

Chatroom Mode

Today, I worked on the Chatroom mode where the user's twitter account is mapped to a chatroom. In this mode, the user can access his twitter account by joining the chatroom twitter-account. The user can then use the same commands that are available in the Single and Multiple contact modes for performing actions actions such as status update, direct messages, fetching home timeline, fetching user timeline etc. The code is still in its initial stages and needs to be tested properly.

Tuesday 19 June 2012

Screencast


A demo of how spectrum's Twitter-Backend can be used to access Twitter. I use Psi for testing/development, but it is also possible to use other clients like pidgin, gajim etc.


 


The steps involved in adding a twitter-account in Psi are outline below.
  1. Under General choose Account Setup.
  2. In the dialog that appears, click on Add to add a new account.
  3. Give a suitable name to the account and proceed to the next step.
  4. An  Account Properties dialog shows up. 
  5. In the Jabber ID field (Account tab) enter - <your twitter username>@twitter.com.
  6. In the Connection tab choose Manually Specify Server Host/Port and enter the IP address (hostname) of the machine on which the spectrum server is running along with the port on which the spectrum listens to incoming connections (Default - 5222).
  7. Click on save and exit Account Properties dialog.

Multiple Contact Mode

Currently, twitter-backend supports two types of modes:
  • Single Contact
  • Multiple Contact
In the Single Contact mode, the XMPP user's roster will have only one contact corresponding to his twitter account labelled twitter. The user can interact with the Twitter network via this special contact that represents his account.

In this Multiple Contact mode, the XMPP user's roster will have the aforementioned special twitter contact and one contact each for the user's followers. Some of the features in this mode include adding /removing contact via the UI (depends on the client used the user), sending/receiving direct messages by clicking on the contact corresponding to the user.

The next step would be to work on the chatroom mode, where the users twitter account will be mapped onto a chatroom.

Friday 15 June 2012

Some more features....

  • Twitter-backend now supports retweeting. The user can use the command #retweet <unique_tweet_id> to retweet. 
  • The user can also follow/unfollow users now using the #follow and #unfollow commands. 

Monday 11 June 2012

Direct Message Updates

Twitter Backend now periodically polls and updates user regarding any new Direct Messages sent to the user by one of his followers. I also added code to populate user's roster with all his twitter friends. As a result, sending direct messages is easier now! The user can just click on one of his contacts and send him a direct message instead of sending direct messages via the special twitter contact using the '@username' command.

Sunday 10 June 2012

Tweet Updates

After making the twitter requests asynchronous, last week I worked on polling the user's home timeline and sending the user updates regarding the new tweets by one of his followers.  I also fixed a minor bug with the POST version of fetch friend request.

Sunday 3 June 2012

Asynchronous Twitter Requests

Over the past three days I worked on making twitter requests asynchronous, which was not the case earlier, mainly due to the CURL calls in libtwitcurl library. The main idea - "Run each request in a separate thread without blocking the main thread". One of the main tasks was to create a generic thread pool framework that provides an easy, clean interface to manage thread life-cycle. The next task was to re-write/re-organize some of the existing code to create requests that can make use of  this thread pool library, thus allowing multiple requests to run concurrently without blocking the main thread. The end result: Twitter-Backend is now more scalable and robust!