[Update - as of 3/25, the site will be called and use the url TwitterRatio.com, but it will still be using TFF Ratio as the statistic]
Over the last two weeks I’ve written about the beginnings of TFFRatio.com and some updates that have been made to the site like a Twitter autoresponder. One of my goals was to create a web service so that others could use TFF Ratio in interesting ways. I’ve been working on a Graffiti widget, which you can see in action here and will be released soon, but today I’d like to jokingly announce the CTP release of the beginnings of the TFF Ratio API. Well, I’m not joking about the announcement; I’m joking about calling it a “CTP”. I’m a little tired of Web 2.0 “Beta” products so I figured I’d call it a Community Technology Preview.
I will update the Twitter Ratio site soon with this information, but for now this is the only place you can find it.
TFF Ratio SOAP Web Service
First, the TFF Ratio SOAP web service: http://TwitterRatio.com/services/ws.asmx
The only method so far is GetTFFRatio, which expects the following parameters, just like the form on the home page of the TFF Ratio site:
The object returned is a TFF Ratio UserInfo object that includes some things from Twitter useful for building badges or whatever you can think of like followers count, friend count, TFF Ratio, and a witty “level” comment.
TFF Ratio POX Web Service
For those so inclined a plain old XML web service is available as well that does the same thing as the SOAP service: http://TwitterRatio.com/services/gettffratio.ashx
It accepts the following parameters either via GET or POST:
The returned results are the same as for the SOAP web service, but just in XML format.
Since your Twitter username and password are submitted to this web service I recommend using this server side rather than client side. I plan on implementing an API key soon that you can submit rather than your Twitter username/password unless Twitter beats me to it (like Jaiku currently does).
TFF Ratio Badge Service
Finally the piece de resistance is something I spent a couple hours on last night sharpening my GDI sword. This service returns a JPEG image: http://TwitterRatio.com/services/badge.ashx
It expects the following sets of parameters:
handle = the twitter username of the person you want the TFF Ratio badge for. If the user you are querying is public then this is all you need. If you are querying a private Twitter user, even yourself, then you should use the below parameters instead of this one (optional)
usernameToGet = the twitter username of the person you want the TFF Ratio badge for (optional, if omitted then returns the TFF Ratio for the username)
username = your twitter username
password = your twitter password
The results are a 180x225 JPEG image. If you plan on using this image in your blog sidebar then I’d recommend using option 1 above (the handle param) otherwise your twitter username and password will be there for the world to see. If you’ve marked your Twitter profile and updates as private then I recommend retrieving the image server side, storing it locally, and then displaying it.
The results of each of the services displays nothing more than what is publicly available from your Twitter profile plus some calculations to determine your TFF Ratio - your followers count divided by your friends count. If you are concerned about your privacy then consider changing your Twitter profile to private so that only your friends can follow you.
TFF Ratio API Usage
Please let me know of any cool things that you do with the API. I plan on awarding some type of prize to the most creative usage(s). I was thinking about having some TFF Ratio T-shirts created, but it may just be as simple as creating a custom comment that will always and only be served with your TFF Ratio.