Imdb library to get movie meta from IMDB.com, since they're too cool to give us an API
Ruby
Switch branches/tags
Nothing to show
Pull request Compare This branch is 46 commits ahead, 44 commits behind maddox:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
doc
lib
spec
README.textile
Rakefile

README.textile

imdb: A simple ruby library to scrape IMDB
or, using Nokogiri to account for IMDB’s utter lack of an API

New Style Usage

New Style usage is pretty close to Old Skool; mostly, it’s just a shift to the preferred Ruby subclass idiom of IMDB::Movie (rather than ImdbMovie). Also, `imdb_id` is now `id` and `type` returns something meaningful.


require 'imdb'

movie = IMDB::Movie.find_by_id('tt1099212')

puts "IMDB ID: #{movie.id}"
puts "Title: #{movie.title}"
puts "Rating: #{movie.rating}"
puts "Release Date: #{movie.release_date}"
puts "Tagline: #{movie.tagline}"
puts "Plot: #{movie.plot}"
puts "Runtime: #{movie.runtime}"
movie.directors.each do |director|
        puts "Director: #{director.name}"
end
movie.writers.each do |writer|
        puts "Writer: #{writer.name}"
end
movie.genres.each do |genre|
        puts "Genre: #{genre.name}"
end
puts "Poster URL: #{movie.poster_url}"

Old Skool Usage and Original Credits


require 'imdb'
require 'imdb/old_skool_compatibility'

movie = Imdb.find_movie_by_id('tt1099212')

puts "IMDB ID: #{movie.imdb_id}"
puts "Title: #{movie.title}"
puts "Rating: #{movie.rating}"
puts "Release Date: #{movie.release_date}"
puts "Tagline: #{movie.tagline}"
puts "Plot: #{movie.plot}"
puts "Runtime: #{movie.runtime}"
movie.directors.each do |director|
        puts "Director: #{director.name}"
end
movie.writers.each do |writer|
        puts "Writer: #{writer.name}"
end
movie.genres.each do |genre|
        puts "Genre: #{genre.name}"
end
puts "Poster URL: #{movie.poster_url}"

Thats about all it does. its simple. I only made it to work with another project.
Thanks to ‘We <} Code’ for the jump start via http://www.weheartcode.com/2007/04/03/scraping-imdb-with-ruby-and-hpricot/