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 to find out how to install it.


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

query = (ARGV + ["album"]).join(" ")
sizes = ["medium", "large", "xlarge"].join("|")
uri = "{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 }