Windows Azure Mobile Services has been an exciting tool I’ve been using to develop my mobile applications. One of the key things when building several kinds of mobile applications is integration with several of the big social networks. Instagram becoming the way to share photos was one of those integration points I needed in my application. Instagram provides a “real-time” API service which uses the PubSubHub model, details about the real-time API can be found on Instagram’s developer site.
My application required the need to have images from Instagram show up in a user’s feed as it was available. At first I thought about just polling the Instagram feed’s using a Scheduled job (which is a part of the mobile service) however this solution did not scale well due to the limited number of SQL Azure connections in the service. This lead me to the real-time API to have Instagram tell me when to update my application. As a part of this I also wanted the user’s to have the ability to specify the tag for which they would like to follow, as well as the username (in many cases their own) they would like to follow as well. Given these requirements I needed a generic enough API which would allow my application to subscribe to these objects in Instagram and then have them populate in my application by storing in a table.
So enough background let’s get to the code.