a poor man’s YouTube API in Ruby.
I’ve been playing with a little Merb app for my new personal website. One of the focuses of the project is for me to focus less on engineering principles and so-called best practices and more on features and doing new, creative things.
Recently I thought it would be cool if YouTube videos I linked to via my Delicious account were automatically embedded in the HTML representation of the Yahoo! Pipes feed which powers the main view of my new site. I came up with this:
CGI.unescapeHTML Hpricot(open(link)).at("#embed_code")[:value]
Now, if you want to split hairs, it’s definitely questionable. However, context is everything, and in my current one, this solution works great.



leave a comment