Skip to content

Instantly share code, notes, and snippets.

@Veejay
Created April 23, 2010 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Veejay/376975 to your computer and use it in GitHub Desktop.
Save Veejay/376975 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'net/http'
require 'mechanize'
require 'cgi'
def get_imdb_id_from_name(name)
a = Mechanize.new
a.get('http://www.imdb.com/find?s=all&q='+CGI.escape(name)) do |page|
link = page.link_with(:text => /name/)
puts(link.href)
end
end
get_imdb_id_from_name("Sean Connery")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment