November 15, 2009
Its Been A While…

Well, its been a few months since I posted last - the genuine joy of interesting/difficult work in my final year as a Physics undergrad - but there’s a fair amount I should probably put up here for posterity:

  • I’ve become very interested in Playdar - an old friend of mine, James Wheare, is a ket developer - and the possibilities music resolution has to offer. As a consequence I released quite a few libraries and a program that helps some of playdar’s features become a little more tangible.

    Voici DAAPlaydar: a script that will resolve playlists of yours (using playdar) and make them available to you via DAAP share. A very cool concept (even if I say so myself!) but it falls short because iTunes is very picky about the DAAP servers it talks to, Songbird works well though :) I hope to be ablet o work a bit more on this in the near future - if you have any expertise with DAAP, you know who to get in touch with!
  • In order to get DAAPlaydar working I had to build a few libraries, one to decode Apple’s DMAP object encoding method (now a ruby gem on gemcutter called (drumroll please) dmap - woop! There’s also PlaydARR, a ruby library for interacting with the Playdar server (also now a gem on gemcutter). So named because pirates help combat global warming. True story.
  • My dashing alter ego Cy Densham has released some more poetry, your opinions are more than welcome.
  • At some point some of the many photos I took while traveling Japan will arrive on Flickr (I’m fighting with FlickrUpload for Aperture at the moment) some of the photos are already up, and of course they’re geotagged so you can just browse to Japan in Flickr to see them.
  • I’ve also realized that one of the projects I enjoyed working on the most isn’t mentioned on here! Shock horror. irotoku is a (very basic) way of hiding information in images - ie. Stenography - the implementation of the decoder I wrote in C here is quick enough that if you hide MP3 data in a (big!) image you can pipe directly from the image through irotoku to an MP3 player and listen to your heart’s content. Good fun.

So that’s pretty much all for now, Cy has some interesting ideas so there may some more stuff up here soon, but he might be pushed down by this newly inspired Physicist and such tedious things as job applications. Yay.

May 24, 2009
SlyPIs, Out in the Wild

I get really frustrated when websites don’t have APIs. I know its kinda mean to screen scrape, and potentially prevented by ToCs etc, but I built this anyway. I have finals exams to revise for and not enough to procrastinate with!

So, what is all this SlyPI nonsense about then?
A SlyPI is a small (YAML based) settings file that describes how to mechanically traverse a website in order to get a variety of different bits of information. For example, my tv.com example will allow you to search their database for shows by name, then use their ‘showid’ to find out about that show’s episodes, its air times, genre and so on.

These settings files on their own aren’t particularly helpful. Lucky for you I built a ruby gem that interprets them and creates a class with methods pertaining to that slypi, so you just do:

require 'slypi'
s = SlyPI.new("tv.com.slypi")
s.SearchShows(:q => "Terminator")

And you’ll get a list of shows that have the word Terminator in them. Cool ne?

So if a SlyPI exists for the site you want to use this is simplicity itself, but why bother making one for a new site? When you screen scrape you run the risk that the site layout will change and everything will be broken. With SlyPI even if it doesyou only need to edit the SlyPI settings file and order is restored. You could feasibly write an application that depended on screen scraping that auto-updated when a newer version of the slypi was available.

Naturally, people get frustrated at screen scraping, so please remember that you use this at your own risk, and definitely don’t attempt to download the entire of a website though it…

May 5, 2009
Ruby-DLC on Github

Ruby-DLC is now available on github, and consequently as a gem! You can install with:

gem sources -a http://gems.github.com
sudo gem install jphastings-dlc
There’s a gist explaining how to use the library and the rdoc documentation is still available on my project page. Please file an issue if you have any problems with the code, I haven’t checked it thoroughly!

3:20pm  |   URL: http://tmblr.co/Zxt1by6BndD
Filed under: ruby code gem github ruby-dlc dlc 
Liked posts on Tumblr: More liked posts »