From 4a8bd6d2bafe9bbbb4c43f06a351fa67b0616699 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 23 Feb 2018 09:54:45 -0500 Subject: Scraper uses config-defined achievements list --- scrape.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scrape.rb') diff --git a/scrape.rb b/scrape.rb index 5d62e89..07faeb6 100644 --- a/scrape.rb +++ b/scrape.rb @@ -3,7 +3,7 @@ require 'nokogiri' require 'open-uri' require 'yaml' -config = YAML.load(open("config.yml")) +config = YAML.load(open("lunatic/config.yml")) usernames = config["usernames"] achieves = usernames.map do |username| @@ -18,8 +18,8 @@ achieves = usernames.map do |username| end end.flatten -if File.exists?("achieves.txt") - already = File.read("achieves.txt").split("\n") +if File.exists?(config["achievements"]) + already = File.read(config["achievements"]).split("\n") all_achieves = achieves + already else all_achieves = achieves @@ -33,6 +33,6 @@ if config.key? "blacklist" all_achieves.reject! { |l| blacklist.include? l } end -File.open("achieves.txt", "w") do |f| +File.open(config["achievements"], "w") do |f| f << all_achieves.join("\n") end -- cgit 1.4.1