Comment on Corripio

I agree with the previous commenters that the artwork it finds is a bit rubbish. I've tried to fix this by coding up a plugin that uses Google Image Search. It's my first Ruby script though, so be gentle :-)

Save the below to a file and then read http://nclasssoftware.com/corripio_scripts/ to find out how to install it.

#!/usr/bin/ruby
#

require 'net/http'
require 'open-uri'
require 'uri'
require 'cgi'

query = (ARGV + ["album"]).join(" ")
sizes = ["medium", "large", "xlarge"].join("|")
uri = "http://images.google.co.uk/images?hl=en&q=#{CGI.escape(query)}&imgsz=#{CGI.escape(sizes)}"

source = open(URI.parse(uri)).read.gsub("\r\n", "")

matcher = /dyn.Img\(".*?",".*?",".*?","(.*?)"/
matches = source.scan(matcher)

matches.first(10).each { |match| puts match.first }