March 22nd, 2009

Display your favorite Friendfeed followers’ avatars right on your own website.
[Update: This widget has moved to FFavatars.com. Please follow that link to customize your own widget.]
Let me just get this out up front. I love FriendFeed. I always have and I probably always will. As you can tell, I’ve practically built my entire website around FriendFeed’s services, including their cool-o-nifty embedded feed widget on my homepage and their badge widget down there on the right-hand side of the page.

Robert Scoble and I Throwing Down The FF Gang Sign at the FriendFeed Lunch in Bellevue, 2008
A few days ago I posted an idea in the FriendFeed Feedback room suggesting that they should also provide a widget that shows the avatars of one’s subscribers. I was thinking of something like the friends block on Facebook, or like other widgets such as MyBlogLog and TwitterRemote. Then last night I starting thinking about building such a widget myself. I’ve never written anything like this before and I know just enough PHP to hurt myself, but I thought this would be a good opportunity to teach myself about JSON.
Thanks to the awesome FriendFeed API documentation, I wound up with a working prototype in just a few hours. Unfortunately the FF API doesn’t directly implement a way to fetch one’s subscribers, so I had to work around this by fetching the list of friends that you are subscribed to and then checking each of those friends to see if they are subscribed back to you. The result isn’t all of your friends, but only those friends who are subscribed to you that you are also subscribed to in return. I’ll call this a feature and say that it filters only your best friends (BFFFF’s).
You can see the widget now on my right-hand sidebar. (That’s right over there ==>)
And here’s how you can try it out on your own website:
[Update: This widget has moved to FFavatars.com. Please follow that link to customize your own widget.]
That’s it! I had to workaround the lack of a subscribers API (nudge, nudge, FF team). So instead of showing all of your friends this only shows 15 random friends by default, unless you change the max parameter. This is probably a good thing anyway.
Also note that the first time your widget loads it may take a few seconds, but after that it will serve the latest cached copy much faster. The cache will be refreshed with a new group of random friends after a short period of time.
If you have any questions, comments, or suggestions, please leave a note in the comments section below.
Thanks!
Alan