Daily project: Automatic Twitter status updater

Courtesy of Venture Capital for Africa
Courtesy of Venture Capital for Africa

I like to read great quotes, because they express the wisdom and the creativity of human race.

So, I was thinking how I can share them automatically on my Twitter account. First task was to find out the source of great quotes and RSS/Atom feeds are perfect data source to complete this task. After some researching I found out few publicly available sources on BrainyQuote.com:

  1. Quotes of the day: http://feeds.feedburner.com/brainyquote/QUOTEBR
  2. Love quotes: http://feeds.feedburner.com/brainyquote/QUOTEFU

After having the source all we need to do now is to parse these RSS feeds and we need also a tool to publish these quotes automatically to the Twitter account.

For parsing RSS I rewrote one C# class that do this job (it reads data from RSS feed which is basically XML and put these data into one list of custom RSS objects).

TweetSharp is nice tool to do automatic updates of your Twitter status. You need to enter four keys from your Twitter application to make this process seamless:

  1. ConsumerKey
  2. ConsumerSecret
  3. AccessToken
  4. AccessTokenSecret

You get these keys after you create your first Twitter application under http://dev.twitter.com

Updating Twitter status is then an easy task:

//You have defined somewhere before: consumerKey, consumerSecret, accessToken, accessTokenSecret
var service = new TweetSharp.TwitterService(consumerKey, consumerSecret);
service.AuthenticateWith(accessToken, accessTokenSecret);
var response = service.SendTweet(new TweetSharp.SendTweetOptions() { Status = quote.Tweet });

After all is programmed and tested I just created an automated task that updates my Twitter status every 4 hours.

What was the result?

I increased the number of followers by 20% in just few days 🙂

Plus, I can read this every day during my lunch break and enjoy in great wisdom quotes.

What need to be improved?

Sometimes I got an empty quote in my Twitter feed – so I need to check the content better before I publish it online.

What’s next?

This mini project could be upgraded into an SaaS service product where users will register, enter the RSS sources from which they want us to parse the data and service will do everything else automatically (publish on Twitter). So it could be named somehow “Intelligent automatic Twitter updater from the given data source”.

Interested? Contact me if you think it could be interesting and you want to contribute to this idea (perfect match would be if you can create the design and user experience for this service).

You may also like