Aggregating Social Media for the iPhone
Twitter, YouTube, Facebook, LinkedIn, Digg, blogs, etc. are all forms of social media. This list goes on and on and is about as infinite as human innovation. New forms are generated weekly, if not daily. Trying to sift through all the social data out there to just keep track of your very own updates can be as daunting as trying to find a needle in a hay stack.
For the iPhone to keep track or even update the user on news feeds it has to make one request per specific social media server. Lets think of it this way, you want to make dinner. Well you would have to go to the grocery to get the ingredients for your 5 course meal. There is all sort of choices to choose from, but you have a set recipe in mind. The catch is, for each ingredient you have to make a separate trip. That doesn't seem very efficient, there in lies the problem.
Your meal consists of Twitter, YouTube, and a personal blog. In order to get an update from each one of these sites you have to make a separate request and wait for the data to be returned. It would seem advantageous to get all the information at once. That’s where our very own custom web service comes into play. Think of it as the middle man, sifting through and retrieving all that wonderful social information to display at the touch of your fingertips.
This was the thought process behind our latest custom application, a Hitcents iPhone App. We built our web service on the .Net platform in order to take advantage of few things. By going this route we can stick to a Test Driven Development design philosophy. Offline or online we can test our service to make sure the data can be read and displayed properly on the iPhone. This allows us to start with a base set of data and expand out from there by just adding new types of social media information. This is just from a design and debugging standpoint, the magic happens in the service.
The web service utilizes REST principles (Representational State Transfer) to be as reusable as possible. The intent was to not have to constantly update the actual iPhone app anytime we make a change to or add new social media feeds. This allows the client side application to be oblivious to the change and reap the benefits. The service can also be used by other clients such as an Android tablet or phone or even the upcoming Windows 8 Metro Style Apps.
The real beauty of the service lies in the caching policy. If you figure it takes 200 ms to fetch a Twitter feed, 100 ms to fetch a YouTube feed, and 200 ms to fetch a Facebook feed its taken you almost half a second to just get an update. Speed is everything on the internet these days, any time you can shave off that is a huge plus. By enabling the caching on the web service you can get the total time down to 100ms. Not to mention if your social feed is down you still will be able to view the most recent updates.
So what have we learned, not all middle men are evil? You can get the best of both worlds? Precisely, you can be agile, dynamic, and efficient, all it takes is a little know how and some web service ingenuity. I'll be back to discuss exactly how we tackled the different social media API'sand how we developed each news feed to fit into our ninja-like service.