Giter Club home page Giter Club logo

imdb's Introduction

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/

imdb's People

Contributors

maddox avatar mschrag avatar purp avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

imdb's Issues

Review fork queue

... see if there are other interesting ideas and either merge directly or figure out how to duplicate

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.