From ef66322a27a7fb252b9cbf704a21cd5bd7e5a134 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 23 Feb 2018 10:41:53 -0500 Subject: Added progress logging to scraper --- scrape.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scrape.rb b/scrape.rb index 92730a5..a28f4c5 100644 --- a/scrape.rb +++ b/scrape.rb @@ -12,7 +12,11 @@ achieves = usernames.map do |username| data = JSON.parse(script[0..script.index(";\r\n\t\t")-1]) ids = data.map { |d| d["appid"] } + index = 0 ids.map do |id| + index += 1 + puts "#{username} - #{index}/#{ids.count}" + achsp = Nokogiri::HTML(open("https://steamcommunity.com/#{username}/stats/#{id}/")) achsp.css(".achieveTxt .achieveUnlockTime + h3").map { |d| d.text } end -- cgit 1.4.1