08.07.07

New Projects - MOTM and the Lifefeed

I've been on a bit of a hiatus from posting this past month, but I have a good enough excuse, namely a few projects I've been working on that have consumed quite a bit of my time. The Lifefeed you see on the right is one of those projects, and manoftheminute.com which is about to hit alpha and launch soon. The Lifefeed is an app I had been wanting to develop for a while, and in fact the redesign of nuttersmark.com was done in preparation for it.

 

There are a lot of widgets available out there that allow you to embed all sorts of information about what you're up to on the web, from your Twitter status to the music you've been listening to. In fact, Typo - the blog software I use - offers a wide variety of such widgets that would be placed in the sidebar to the right in any order I choose. These widgets are fine and dandy, but I wanted to take them one step further and provide a constant stream of information about what I'm doing on the web to be available for viewing in Chronological order. Since there's no way to merge all the widgets out there, this had to be done hooking into the many API's available out there using Ruby on Rails.

 

Currently I'm using the Digg, Flickr, Twitter, and Scrobbler gems. I can add more later depending on what services I start to use, but I spend most of my time using those four services so I'll stick with that for now. So at any given moment, you can see what pictures I've been uploading, stories I've been digging, music I recently fell in love with, and my general status. There are two flickr gems, one called "flickr" and the other called "rflickr" which supports more functions than "flickr", but I went with the former written by Scott Raymond because of some complications involved with validating the API key in rflickr. The flickr gem allows you to grab photos from a particular user which have attached to them a wide variety of information, such as the date and time the photo was taken, and the tags, titles, and descriptions. The Digg gem was written by John Wulff shortly after the Digg API was released and has close to full support for all the available calls. All I was interested in was pulling diggs in as I dugg them with the title, link, and date-stamp, and John's gem does that admirably. I actually don't think it's in gem form as of yet, so let's just call it the Digg wrapper for now. I just recently started using Last.fm, which for me is probably not entirely worthwhile since I usually have to go out of my way to listen to music, but I feel like it could provide some motivation for me to do so more often and I think last.fm is just the tops. The ruby gem that hooks into last.fm is called 'scrobbler' and as you might have guessed it can pull down tracks I recently "loved" with a date-time-stamp. Noticing the link associated with each song brings you to a page where you can listen to a short clip of that song, I thought it would be neat to add those clips to each song in my lifefeed. Since those clips can be embedded with some markup provided by last.fm, I thought this would be straightforward enough. The only problem was that the scrobbler gem doesn't return the specific code for each artist needed to embed the song clip. To get these codes, it seemed, I would need to scrape it off the song's page itself with the help of hpricot, the ruby html parser. So scrobbling took a little more effort than I thought it would, but it's working well now and people can get a taste of the music I'm listening to these days without having to leave my website. Finally, there is the twitter gem, which is about as straightforward as gems get. The only real problem I ran into with it was the fact that Twitter only allows one request per minute for information from a specific profile. Go past this limit and you get errors, which is irritating but not a game-breaker; I don't tweet more than 5 times per day. While all these API ruby gems are neat, they all suffer from the same problem, namely speed. I'm not sure if it's something I'm doing wrong, but requests for more than a couple items from these services takes a loooong time, resulting in dreaded proxy errors. Now I don't have this problem nearly as often when running the Lifefeed app locally, but it does occur if I try to request too many items. When I'm live on Mediatemple though, I get proxy errors all the time. It happened so often in fact that I had to change my strategy to make the app even usable.

 

Instead of pulling all the information for the last 20 or so events every time someone visited the page, I had to throw them into a database to speed things up. This would have been unavoidable anyways because of the problem with Twitter mentioned above. So now, every time a new item is pulled from a service, the html is generated and stored into the a row in the Lifefeed table. This forced me to change the dates from a "blank hours ago" format to a specific date stamp, which is clumsier to read. Because proxy errors were occuring so frequently, I had to throw the action of checking for new items into a period remote call which would wait 10 seconds before running. The nice part about taking this direction was that I was able to add a little ajax goodness to the process. Now when a new item is found, it slides into place at the top of the feed (granted it's the newest item), giving the user the illusion that they're getting information about what I'm up to as it happens. To make it even more functional, I have this checker run every two minutes so that people who are reading a long article will see what I was doing during that period. I'm sure nobody gives a rats ass, but you never know in this world of Tweets, Tumblogs, and Facebooks.

 

I actually can see some practicality in the Lifefeed, however. This past spring I did a live photo blog of a run I did in San Francisco and I'm told it was fairly interesting to follow, so the Lifefeed could allow for this any time. My iPhone makes it very simple to quickly upload photos to my flickr account, complete with titles, descriptions, and tags, and since I'd be running with my iPhone anyways (since it's my only iPod now), it works out perfectly. Perhaps I'll have to start doing more interesting things in my life to make the Lifefeed app truly interesting. For now, you will have to be content with hearing about me sitting on my ass in front of the computer twelve hours out of the day.

 

So there you have it, my Lifefeed. I plan to make a public version available that anyone can embed in their blog using some javascript or an iframe where all that's necessary is the username for each service. It will be completely customizable with CSS and perhaps I could put some options in like what type of information to display for each item and how many items to display at a given time. Keep an eye out for that. My next project for NuttersMark.com is the linkroll. In addition to providing links I find valuable, I think it would be neat to allow visitors to add links of their own, whether it be a link to their blog or anything else of interest. There would be categories to select, so that if it was a link to their blog I could confirm it's not spam and approve it. In fact, I see this type of functionality being something all blogs could and maybe even should have. It would be a great way to swap links without having to spam people over email. Meanwhile, I'm going to be putting my full effort into launching the Alpha of Manoftheminute.com for the next week or so. Check back for information on that.



Subscribe to Just a Nutter RSS Feed

Comment_button_spacer

Current Projects

Area Studios

My web development company and project incubator. We’re always looking for interesting projects. Stop by and check out our work.

View Now

oqodo.com

Oqodo started as a mini competition between a friend and myself to build an app for our friends to keep in touch. It will soon grow into something much bigger.

View Now

My Web Presence

Flickr
Facebook
Digg
Lastfm
Linkedin
Twitter
Basecamp