Socket
Book a DemoInstallSign in
Socket

bootleg

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bootleg

bundlerRubygems
Version
0.0.7
Version published
Maintainers
1
Created
Source

Bootleg

Bootleg represents my playground for scraping movies from moviefone.com

If you want you can play with it as well

To gain access to the gem simply:

require 'bootleg'

Currently Bootleg supports search for movies and theaters within a certain zipcode.

agent = Bootleg::Agent.new(zipcode: 20851)

The bootleg agent is responsible for initializing the enviornment and providing a simple method page that gives us access to the first search results.

page = agent.page

A page has two handy methods. The theaters method gives you an array with all the available theaters. You have access to a theater's title, link, price for an adult or the price for a child as well as the address of the theater and the movies that are currently palying at that theater. The page also has a next method that give you access to the next page. You can keep navigating through the search results until page.next returns Last Page.

page = page.next

Within theaters you also have access to movies. A movie has attributes for title link and showtimes.

theaters = page.theaters

This gives you a list of theaters on the current page.

For example if you would like access to all the movies that run in a certain theater you could do the following.

theaters.first.movies

If you need to scrape additional information from either theaters or movies it is fairly easy to extend either the theater class or the movies class.

TODO

Some of the main improvements this gem could use is better error support for different edge cases. The gem could also benefit from more tests to ilustrate some of the patterns identified while scrapping movies and theaters.

FAQs

Package last updated on 25 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts