Sha256: 7173f1da9caa97c2ed62aa649dae6fbc4ad802c72791db4641765d9f6a76e2b9

Contents?: true

Size: 373 Bytes

Versions: 6

Compression:

Stored size: 373 Bytes

Contents

class GameScraper

  def initialize
    @html = Nokogiri::HTML(open("http://store.steampowered.com/"))
    @games_html = @html.css("#tab_topsellers_content a")
  end

  def run
    @games_html.map do |game|
      fields = {}
      fields[:name] = game.css(".tab_item_name").text
      fields[:price] = game.css(".discount_final_price").text
      fields
    end
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
game_gem-0.6.0 lib/game_gem/gamescraper.rb
game_gem-0.5.0 lib/game_gem/gamescraper.rb
game_gem-0.4.0 lib/game_gem/gamescraper.rb
game_gem-0.3.0 lib/game_gem/gamescraper.rb
game_gem-0.2.0 lib/game_gem/gamescraper.rb
game_gem-0.1.0 lib/game_gem/gamescraper.rb