The Storyteller

Building services like FriendFeed using PHP – Part 1

May 31, 2008 · 22 Comments

Friendfeed is an excellent life streaming service aggregating all your feeds from different service providers, compile them together, build a social network among your known people and finally deliver all these feeds as a mashup. As a result you can immediately track activities of your friends on all the different service they use (like jaiku, twitter, flickr) and stay up-to-date. Hats off to the developers of FriendFeed for delivering such a nice application to us.

In this blog post I will try to focus on how to develop such a service like Friendfeed using PHP and JS and how to scale such a huge load successfully. Previously I’d also written another article focusing “How to develop services like SpringLoops using PHP“. The complete article will be delivered in multiple installments and in current installment, I will focus on Photo sharing services used by friendfeed.

Area to focus
1. Services to be supported
2. Update discovery
3. Parsing the feeds
4. Storing the data
5. Scaling

FriendFeed parses feeds from a total of 35 popular services from around the web ;) – lets have a look at them one by one and I will give you idea about the access points of these services. Though Not all of them are feed, so I will try to focus those services as well to give you a basic idea.

Service 1 : Flickr
Usable PHP Library: PHPFlickr

Flickr is an excellent photo sharing services under the banner of Yahoo. Friendfeed parses all the photo from a user and also the list of his/her favorite photos. Given an username you can easily find the Flickr ID like (76536911@N00)of that user and once you got it, here is the access points for list of public photos and favorites

List of photos
http://api.flickr.com/services/feeds/photos_public.gne?id=<user’s flickr id>&lang=en-us&format=rss_200
example: http://api.flickr.com/services/feeds/photos_public.gne?id=76536911@N00&lang=en-us&format=rss_200

List of favorites
http://api.flickr.com/services/feeds/photos_faves.gne?nsid=<user’s flickr id>&lang=en-us&format=rss_200
example:http://api.flickr.com/services/feeds/photos_faves.gne?nsid=76536911@N00&lang=en-us&format=rss_200

Service 2: Picasa Web Album
Picasa is another photo sharing service under the banner of the Giant, Google. Given a picasa user name , here are the access point of user’s public photos

List of public photos
http://picasaweb.google.com/data/feed/base/user/<picasa user name>?kind=album&alt=rss&hl=en_US&access=public
example:http://picasaweb.google.com/data/feed/base/user/countdraculla?kind=album&alt=rss&hl=en_US&access=public

Service 3: Smugmug
Here comes another photo sharing service where users can buy and sell their photos. Given a smugmug user name you can find the feed of this user’s photos

List of public photos
http://<smugmug user name>.smugmug.com/hack/feed.mg?Type=nickname&Data=Ifocus&format=rss200
example:http://ifocus.smugmug.com/hack/feed.mg?Type=nickname&Data=Ifocus&format=rss200

Service 4: Zoomr
Zoomr is another photo sharing service started in late 2005 by Kristopher Tate as a place for him to share photos with his friends and later became a public services, is currently supported by FriendFeed. And here we go with the access points :)

List of public photos
http://www.zooomr.com/services/feeds/public_photos/?id=<zoomr user name>&format=rss_200
example:http://www.zooomr.com/services/feeds/public_photos/?id=wolfmank&format=rss_200

In next part, I will highlight the access points of supported bookmark services and news services supported by FriendFeed :) Have a nice weekend.

Categories: PHP · Social Networking · howto · idea
Tagged: ,

22 responses so far ↓

  • Omi Azad // May 31, 2008 at 8:23 pm | Reply

    Cool.

    Lage Raho!

  • TRIVUz // May 31, 2008 at 8:24 pm | Reply

    wow….. great… keep it up :D

  • ranacse05 // May 31, 2008 at 8:45 pm | Reply

    i think i was looking for this :D

  • manchumahara // May 31, 2008 at 8:48 pm | Reply

    Thank u very much for this post. Hope I will try something from here.

  • Sebastian // May 31, 2008 at 8:55 pm | Reply

    see http://noserub.com/

  • hasin // May 31, 2008 at 10:28 pm | Reply

    @Sebastian Nohn

    Thanks a lot, I didnt know about it :)

  • Anupom // May 31, 2008 at 10:57 pm | Reply

    Cool, carry on!

    We will learn a lot from this series of posts.

    Eagerly waiting to see the final implementation.

  • Ali B. // June 1, 2008 at 3:28 am | Reply

    Nice read, thanks!
    I am interested in part 3 and 4. Most importantly how are you willing to tackle storing onlythe delta of the feeds entries (new feeds).

  • Ahsan // June 1, 2008 at 2:00 pm | Reply

    Would love to read more about it, waiting for the rest :)

  • hasin // June 1, 2008 at 4:28 pm | Reply

    @Ahsan, Anupom, Ali.B

    Thanks for the nice words. Next installments are coming soon :)

  • azzam // June 1, 2008 at 4:45 pm | Reply

    thanks for the post.
    I have been talking over with some of the reps for friendfeed to develop a wdiget for the service and a pretty cool intervention with their API, just getting the developers together.

    the noserub solution is frigging awesome. Its a shame that services like that are not getting their due PR

  • azzam // June 1, 2008 at 4:55 pm | Reply

    However ‘noerub’ seems to be a service that offers a script that can decentralise social streaming, however as far as a read it you would add a script to your own site that ‘connects’ to the other versions of noserub around the web.

    interesting

  • afruj // June 2, 2008 at 6:18 am | Reply

    Its great, waiting for the rest.

  • Nenko Ivanov // June 2, 2008 at 8:16 pm | Reply

    Thanks for the post. Will wait the rest :)

  • Building services like FriendFeed using PHP - Part2 « The Storyteller // June 3, 2008 at 11:57 am | Reply

    [...] WP Themes ← Building services like FriendFeed using PHP – Part 1 [...]

  • Skylog » Blog Archive » links for 2008-06-03 // June 3, 2008 at 12:31 pm | Reply

    [...] Building services like FriendFeed using PHP – Part 1 (tags: php) [...]

  • Shaun // June 3, 2008 at 6:27 pm | Reply

    So all you are saying is if you know how to store user data in a database and know how to parse rss/xml feeds then you are a-ok?

  • hasin // June 3, 2008 at 6:29 pm | Reply

    @shaun

    nope, not at all – there will be a detailed post about scaling such a huge load. But these are just the appetizers :)

  • Building services like FriendFeed using PHP - Part 1 : PHP Resource // June 4, 2008 at 12:35 am | Reply

    [...] By Hasin Hayder [...]

  • eresscole // July 9, 2008 at 8:08 pm | Reply

    tests time mashine

  • gtxt − Cosas interesantes en 2008-12-18 // December 19, 2008 at 2:25 pm | Reply

    [...] Posted an item on FriendFeed. Building services like FriendFeed using PHP – Part 1 « The Storyteller (via FriendFeed) [...]

  • Online Bank expert // April 13, 2009 at 2:44 pm | Reply

    It is great. But i don’t know about php. My interest in banking.

Leave a Comment