Visit my site @ mugunthkumar.com


iPhone Tutorial: Follow Cost API and a open source wrapper

December 22nd, 2009 by Mugunth Kumar

What is Follow Cost?

Follow Cost is a interesting and powerful statistic that helps you check the “cost” you would incur by “following” a person on twitter. This is a very useful statistic that I think every twitter client should adopt.  Tweetie for iPhone was the first to implement follow cost and I use this feature of tweetie to check whether a follower is “worth the pain” (as follow cost puts it).

In short, Follow Cost gives you an approximate count of the number of updates a person tweets in a day. As a thumb rule, I don’t follow anyone with a follow cost of over 40. A celebrity with a high follow cost is @guykawasaki. (80+ at the time of this writing) His tweets are interesting, but is it worth the pain? Depends. To me, definitely not.

The API



Follow Cost has a relatively simple API. But unfortunately, even after 3 months of Tweetie 2 launch, no other twitter client has implemented. You just have to make a GET request to followcost.com server with the twitter username as follows.=


http://followcost.com/<username>.json

The resulting output is a json formatted string which can be parsed using any JSON Framework.

Objective C Code

To make life easier, I wrote a helper class MKFollowCost. To use the class, first download the JSON framework and follow their installation instructions. If you are writing a twitter client, chances are that, you would probably have done this. Download the code from below and drag the two files, MKFollowCost.h and MKFollowCost.m into your project.

You can instantiate a followcost object by

MKFollowCost *followCost = [[MKFollowCost alloc] initWithTwitterName:@”mugunthkumar”];

All of the variables like, milliscobles, tweets per day etc, can be accessed from this object. The object is designed to be embedded without your Twitter Profile object.

Downloads

FollowCost Objective C Wrapper: FollowCost v1.0

Rights

You can use it in your own Twitter client, royalty free. Attributing me is upto you. However, if you modify the source code, please make it open source.

If you enjoyed this post, make sure you subscribe to my RSS feed!

Related posts:

  1. Consuming a RESTful Service (bit.ly) in an iPhone Application bit-ly-rest-api-objective-c Introduction Of late, many programmers who develop for...
  2. bit.ly wrapper for Objective-C/iPhone Continuing from my part 1, in this section, we will...
  3. iPhone Tutorial – In-App Purchases Last week, Apple announced that in-app purchases will be available...
  4. iPhone Tutorial – UISearchDisplayController with NSPredicate Though UISearchDisplayController is seemingly easy (and yes it’s easy), apart...
  5. iPhone Tutorial – Enabling reviewers to use your In-App purchases for free In-App purchases is a great way for developers to upsell...






This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

2 Responses to “iPhone Tutorial: Follow Cost API and a open source wrapper”

  1. [...] post:  iPhone Tutorial: Follow Cost API and a open source wrapper | blog … By admin | category: iPhone Cost | tags: charger, cost, details-as-yet, follow, how-much, [...]

  2. That is a excellent entry, not that hard to read. Thank you for taking time for you to reveal your actual thinking.

Leave a Reply


9 visitors online now
9 guests, 0 members
Max visitors today: 13 at 12:58 am SGT
This month: 58 at 03-01-2010 02:57 am SGT
This year: 59 at 02-12-2010 06:23 am SGT
All time: 59 at 12-19-2009 09:48 pm SGT