Twitastic Twitter Enhancer

If you're new here, you may want to subscribe to our RSS feed. Thanks for visiting!

I have written a GreaseMonkey script that enhances the use of Twitter using the web version on Firefox. First version adds:

  • Automatic link hashtags and grab latest tweets using Twitter API

Upcoming features

  • Follow directly from stream
  • Get detailed user info from stream
  • See if User follows back directly
  • Integrate third party services

Download the script at UserScripts

[Post to Twitter] Tweet This

Comments (1)

How to integrate Twitter with your Applications

Twitter offers a very specific functionality, allowing users to post tweets consisting of a maximum of 140 characters. First some people see the 140 characters as something that holds back functionality and areas of use, after a while a big percentage of the skeptics finds good use of the twitter tweets, finding that twitter has a natural belonging in the communication spectra somewhere between instant messaging, sms and blogging. In this post we will discuss how this microblogging tool can be integrated into your webapp and hopefully extend the functionality of your webapp and Twitter.

Twitter API

A lot of the different Web 2.0 companies that have grown into big players the last few years offers developers, bloggers and other users the possibility to consume their content via API:s. API stands for Application Programming Interface and in short it enables other systems to get structured data that easily could be used on other systems. Twitter offers an API as well. You can both use the API for reading data, and for actually update or add data as well. API:s enable the possibility to build advanced web solutions where Twitter data is a part of the applications architecture. In this article we will not go directly into different methods available in the API, we will only discuss how you could do in order to integrate Twitter using the API on a higher level.

Getting Data from Twitter

One of the easiest ways to use the Twitter API is to actually grab data from Twitter via the API, and store and massage it before presentation on your webapp. In order to do this, the only thing you need to do is to choose what data you are interested in and make sure you are using the correct methods in the Twitter API. In order to do this dynamically, you should of course your users share their screen name making it easier for you to dynamically retrieve, store and present data that your users have added to the Twitter application. There are a lot different content aggregators that do this today, FriendFeed is one of the more famous ones. If you are running a community this could be a good way for your users to advertise their twitter tweets on your community. For blog owners, this could also be a good tool to use in order to show that you do not only blog, you are writing stuff on Twitter as well. There are a lot of different solutions already that you could look into today in order to achieve this:

  • Wordpress plugin
  • Widgets
  • Frameworks
  • API documentation

Updating Twitter from Your Webapp

Now it is getting more interesting. Twitter also lets you update status messages via the API. And as we said earlier API:s main feature is the possibility to easily integrate two or more systems and share data between them. Wouldnt it be cool if someone using your system could “automagically” update their Twitter account whenever something important happens on your system. There are two things that have to be taken care of in order to make this feature valuable to the user and the Twitter network:

  • The update should not happen to often because system messages may look like spam after a while, and followers may eventually stop following the user.
  • The user has to either submit their credentials each time an update should be done, or they have to store their credentials on your site in order to make the updates transparently.

If you find a solution that fits your users when it comes to update interval and security and integrity, you will find you know have a very strong tool. This tool will enable you to grow the numbers of users used wisely. Lets say that Poker Site PokerSite.com decides that they will let users registered at them to connect their Twitter account in order to update the twitter account whenever the person wins money or enters a tournament where there are overlay (see definition on WikiPedia). Given that the user who plays at PokerSite.com is connected to people who more or less fancy the same thing as he/she does, these messages will probably lead to leads.

Updating Your Webapp Using Twitter

Now we are getting really groovy. How about using Twitter as a command language? Lets say you have a web application named TheApplication, you make sure that you have registered @TheApplication as a user on Twitter. There are three possible ways to go about using this user account:

  • Take all messages sent to @TheApplication and use as content on your site
  • Take each message sent to @TheApplication, look who sent it, see if he/she is a customer and update parts of the system connected to him/her
  • Do as in points above and let the message itself be a command language with a well defined API talking to your webapp.

What must you do in order to achieve this?

  • Periodically you must get your status list and look for messages sent to @TheApplication
  • Scan the message for commands
  • Identify sender
  • Look Through User Database in order to see the sender is a valid user on your system
  • Pass parsed data to your Twitter Message Command Component who do whatever you have taught him to do when he gets a message sent to him.

In order to be able to achieve the personal sending in this you have to of course store the Twitter usernames locally connected to your users. A good thing with this solution is that you do not need to store credentials (password). The user only has to share the nickname.

There is no end on how you could use this feature. You could control your home entertainment server from work, you could update working hours in salary systems, you could probably even start your water boiler via sms 2 minutes walk from home.

Data Mining Twitter and Complications Doing it

There are some services out there that do data mine (systematically retrieve data via the Twitter API) Twitter and creates new views of the content for search, tag clouds or other types of statistical views on the Twitter data. But there are some things you should know before doing this:

  • The Twitter API only allows 100 requests / hour / client
  • Data mining will have impact on your storage needs
  • Data mining will have impact on your processing power

But if you think you can handle these restrictions, data mining the API opens up for very interesting solutions.

Summary

Twitter as well as other Web 2.0 websites offers developers and others access to their content via API. This opens up for new possibilities using Twitter. In this article we have focused on different areas of use for the Twitter API. Keep following us on more in depth articles on how to implement these solutions using technologies such as PHP, JavaScript and Java.

[Post to Twitter] Tweet This

Comments (1)