The IMDB gem allows you to easy access publicly available data from IMDB.
IMDB currently features the following:
- Search for movies and TV series
- Retrieve the Top 250 listing
- Retrieve complete movie information
- Retrieve TV series and episode information
Read the documentation to see all you can do with this gem.
i = ::.("0095016") i.title #=> "Die Hard" i.cast_members.first #=> "Bruce Willis"
serie = ::.("1520211") serie.title #=> "\"The Walking Dead\"" serie. #=> 8.8 serie.seasons.size #=> 3 serie.season(1).episodes.size #=> 6 series.season(1).episode(2).title #=> "Guts"
i = ::.("Star Trek") i.movies.size #=> 97
gem install imdb
Or, if you're using this in a project with Bundler:
gem 'imdb', '~> 0.8'
As this gem uses content from imdb.com, the test suite uses a set of
pre-defined fixute files in
spec/fixtures. These fixtures are
copies of imdb page used in tests.
Run bundle install to install all dependencies, including fakeweb, which will serve the fixture files instead of doing actual requests to imdb.com.
$ bundle install
Next, simple run
rake to run the entire test suite.
Running against actual IMDB data
It's possible to run the test suite directly against imdb.com. This has two disadvantages:
- Tests will be slow
Running tests often will probably get you into trouble, see Disclaimer.
$ LIVE_TEST=true rake
If you want to run against actual imdb data, it's better to just update the fixture files once with up-to-date content:
$ rake fixtures:refresh
When you run the test suite now, it will use the updated fixture files.
Neither I, nor any developer who contributed to this project, accept any kind of liability for your use of this library.
IMDB does not permit use of its data by third parties without their consent.
Using this library for anything other than limited personal use may result in an IP ban to the IMDB website.
This gem is not endorsed or affiliated with IMDB, or IMDb.com, Inc.