class Horror::Movie::Scraper

Public Class Methods

new() click to toggle source
# File lib/horror/movie/scraper.rb, line 8
def initialize
        @site = "https://www.rottentomatoes.com/top/bestofrt/top_100_horror_movies/"
        @doc = Nokogiri::HTML(open(@site))
end

Public Instance Methods

movie_info(movie) click to toggle source
# File lib/horror/movie/scraper.rb, line 21
def movie_info(movie)
  Nokogiri::HTML(open(movie.movie_url))
end
scrape_horror_movies() click to toggle source
# File lib/horror/movie/scraper.rb, line 13
def scrape_horror_movies
        rows = @doc.css("table.table tr")
        rows.shift
        rows[0..24].each do |row| 
                listing = Horror::Movie::Listing.new(row)
        end
end