Bootleg is a basic scraper. It scrapes movie, theater and showtime details from moviefone.com based on a certain zipcode for a 25 mile radius.
Add this line to your application's Gemfile:
gem 'bootleg'
And then execute:
$ bundle
Or install it yourself as:
$ gem install bootleg
Generate models and migrations:
$ rails generate bootleg:install
Load content for a certain zipcode:
Example:
$ Bootleg.load('21102')
This will load all the movies for a 25 mile radius(including their showtimes and the theaters where they play).
Examples:
$ movie = BootlegMovie.where(name: 'Example').first
Get all the theaters where the movie is played:
$ theaters = movie.theaters
Get all the showtimes:
$ showtimes = movie.showtimes
Get the theater of the showtimes:
$ theater = showtimes.first.theater
The content is stored in 3 Active Record models BootlegMovie, BootlegTheater and BootlegShowtime. After you load a zipcode just start a rails console and take a look at the models to see what information is stored inside.
The zipcode is stored under BootlegShowtime.:w
- 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
It is relatively easy to pull other information from moviefone.com. If you need an extra feature and you would like to contribute feel free to shoot me an email at [email protected] beforehand.