diff options
-rw-r--r-- | scrape.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scrape.rb b/scrape.rb index c70fcff..92730a5 100644 --- a/scrape.rb +++ b/scrape.rb | |||
@@ -7,13 +7,13 @@ config = YAML.load(open(ARGV[0])) | |||
7 | usernames = config["usernames"] | 7 | usernames = config["usernames"] |
8 | 8 | ||
9 | achieves = usernames.map do |username| | 9 | achieves = usernames.map do |username| |
10 | page = Nokogiri::HTML(open("https://steamcommunity.com/id/#{username}/games/?tab=all")) | 10 | page = Nokogiri::HTML(open("https://steamcommunity.com/#{username}/games/?tab=all")) |
11 | script = page.css(".responsive_page_template_content script").text[18..-1] | 11 | script = page.css(".responsive_page_template_content script").text[18..-1] |
12 | data = JSON.parse(script[0..script.index(";\r\n\t\t")-1]) | 12 | data = JSON.parse(script[0..script.index(";\r\n\t\t")-1]) |
13 | ids = data.map { |d| d["appid"] } | 13 | ids = data.map { |d| d["appid"] } |
14 | 14 | ||
15 | ids.map do |id| | 15 | ids.map do |id| |
16 | achsp = Nokogiri::HTML(open("https://steamcommunity.com/id/#{username}/stats/#{id}/")) | 16 | achsp = Nokogiri::HTML(open("https://steamcommunity.com/#{username}/stats/#{id}/")) |
17 | achsp.css(".achieveTxt .achieveUnlockTime + h3").map { |d| d.text } | 17 | achsp.css(".achieveTxt .achieveUnlockTime + h3").map { |d| d.text } |
18 | end | 18 | end |
19 | end.flatten | 19 | end.flatten |