class Popcorn::Scraper

Public Class Methods

get_movie_synopsis() click to toggle source
# File lib/popcorn/scraper.rb, line 45
def self.get_movie_synopsis
      ids = []
  @@doc.css("tbody td.titleColumn a").each do |title|
              ids << title.attribute('href').value
      end
      ids.each do |id|
              @@info << Nokogiri::HTML(open("https://www.imdb.com#{id}")).css("div.summary_text").text.strip 
  end
  @@info
end
get_topbox_gross() click to toggle source
# File lib/popcorn/scraper.rb, line 28
 def self.get_topbox_gross
  @@doc.css("tbody tr td.ratingColumn").each do |w_rev|
    if w_rev.css("span").attribute("class")
      @@gross << w_rev.text.strip
    end
  end 
  @@gross
end
get_topbox_titles() click to toggle source
# File lib/popcorn/scraper.rb, line 12
def self.get_topbox_titles
  @@doc.css('tbody tr td.titleColumn a').each do |title|
    @@titles << title.text
  end
  @@titles
end
get_topbox_weekend() click to toggle source
# File lib/popcorn/scraper.rb, line 19
def self.get_topbox_weekend
  @@doc.css("tbody tr td.ratingColumn").each do |w_rev|
    if !(w_rev.css("span").attribute("class"))
      @@weekend << w_rev.text.strip 
    end
  end 
  @@weekend
end
get_topbox_weeks() click to toggle source
# File lib/popcorn/scraper.rb, line 38
def self.get_topbox_weeks
  @@doc.css("tbody tr td.weeksColumn").each do |week|
    @@weeks << week.text.to_i
  end
  @@weeks
end