about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--scrape.rb4
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]))
7usernames = config["usernames"] 7usernames = config["usernames"]
8 8
9achieves = usernames.map do |username| 9achieves = 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
19end.flatten 19end.flatten