A parser for the IMDB actor and actress files.
Parses the actors.list
and actresses.list
files from IMDB's alternate interfaces page.
Add this line to your application's Gemfile:
gem 'imdb-parser'
And then execute:
$ bundle
Or install it yourself as:
$ gem install imdb-parser
Here is a simple example of how to use the library. Run rspec
to see a list of the available methods.
require 'imdb/parser'
parser = IMDB::Parser::Parser.new(File.open("actors.list" ,'r:ISO-8859-1'))
parser.each do |actor|
puts actor.name
puts "=" * actor.name.length
actor.roles.each do |role|
puts " * #{role.title} (#{role.character})"
end
puts
end
The files provided by IMDB are encoded as ISO-8859-1
. Make sure you open the files as such or you will get encoding errors.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
- Use the utility "next_edgecase" utility to generate a test case for the broken record
ruby -I lib tools/next_edgecase.rb /path/to/actors.list
- Add the resulting case to
spec/role_spec.rb
in thedescribe "::parse" do
section. - Fix it