Enterprise Integration Zone is brought to you in partnership with:

Bilgin Ibryam is a software engineer with Master's degree in Computer Science and currently working for Red Hat in London. He is also the author of "Instant Apache Camel Message Routing" book, an open source enthusiast, Apache OFBiz, and Apache Camel committer. In his spare time, he enjoys contributing to open source projects and blogging at ofbizian.com. Bilgin is a DZone MVB and is not an employee of DZone and has posted 24 posts at DZone. You can read more from them at their website. View Full User Profile

Live Photo Streaming from Twitter, Instagram and Tumblr

05.06.2013
| 3791 views |
  • submit to reddit

The Good If you don't want to read, but see it in action, go to www.livephotostream.com
Streaming real time images from Twitter during the London Olympics was fun. Camelympics turned out to be an interesting(mostly for the developers) project:

Claus Ibsen (the core Camel rider) blogged about it and it was mentioned on DZone.

Bruno Borges' talk on "Leverage Enterprise Integration Patterns with Apache Camel and Twitter" at JavaOne conference (slides available here) had the demo inspired by Camelympics.

Streamed millions of images, had more than 1024 visitors on my blog and 5 comments - not bad. All that with less than 128 lines of Camel code, a little javascript to rotate the images on the client side and powered by free AWS micro instance. Camel is tiny enough to do real time streaming, filtering, throttling, serializing, and serving pages with half a gig memory.

The Bad The Olympics are over. Limiting photos to a certain topic or tag is fine during an events, but not good enough in long term.

Websockets are not widely supported yet. IE doesnt support them, mobile browsers doesn't support them. The only Android browser I found with websocket support is Dolphin Broser, but then 3G networks are not fast enoug to cope with real time (even throttled) image streaming. It needs at least another year before Websockets become widely useful.

Twitter introduced new Developer Rules and limits to make life harder.

As Bruno proved during the live Twitter demo at JavaOne conference, Twitter is the world's largest nsfw photo streaming service, and there is nothing you can do about it (yet).

The Pivot Finally decided to invest the first 10 bucks for a domain name and the result was livephotostream.com

Extented the application, so in addition to Twitter it also retrieves photos from Instagram and Tumblr in "real time". Tumblr doesn't have a real time api, and Instagram's real time api, based on tags is useless. So I had to come up with some clever ways to give the same real experience for the user.

Added search functionality. It is actually a real time filtering functionality - the application will monitor Twitter, Instagram and Tumblr for photos with a given tag and stream only these images as soon as they are posted. I am not aware of other application doing it.

Decided to replace the custom styling with Bootstrap, it just works.

and the result is...
livephotostream.com
The experiment continues, looking forward to hear your constructive feedback.

 

Published at DZone with permission of Bilgin Ibryam, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)