class TldrNews::Scraper

Public Class Methods

new() click to toggle source
# File lib/tldr_news/scraper.rb, line 4
def initialize
end

Public Instance Methods

get_page() click to toggle source
# File lib/tldr_news/scraper.rb, line 7
def get_page
  Nokogiri::HTML(open('https://tldrworldnews.com/'))
end
make_articles() click to toggle source
# File lib/tldr_news/scraper.rb, line 15
def make_articles
  scrape_articles.each do |listing|
    TldrNews::Article.new_from_html(listing)
  end
end
scrape_articles() click to toggle source
# File lib/tldr_news/scraper.rb, line 11
def scrape_articles
  self.get_page.css('div.listing')
end