diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-02-23 09:54:45 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-02-23 09:54:45 -0500 |
commit | 4a8bd6d2bafe9bbbb4c43f06a351fa67b0616699 (patch) | |
tree | f9e79f41399b92319e56b429dd71f2d04d616bd5 /scrape.rb | |
parent | b77ab7cb283e64fb8b23f4892115644e84596842 (diff) | |
download | lunatic-4a8bd6d2bafe9bbbb4c43f06a351fa67b0616699.tar.gz lunatic-4a8bd6d2bafe9bbbb4c43f06a351fa67b0616699.tar.bz2 lunatic-4a8bd6d2bafe9bbbb4c43f06a351fa67b0616699.zip |
Scraper uses config-defined achievements list
Diffstat (limited to 'scrape.rb')
-rw-r--r-- | scrape.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scrape.rb b/scrape.rb index 5d62e89..07faeb6 100644 --- a/scrape.rb +++ b/scrape.rb | |||
@@ -3,7 +3,7 @@ require 'nokogiri' | |||
3 | require 'open-uri' | 3 | require 'open-uri' |
4 | require 'yaml' | 4 | require 'yaml' |
5 | 5 | ||
6 | config = YAML.load(open("config.yml")) | 6 | config = YAML.load(open("lunatic/config.yml")) |
7 | usernames = config["usernames"] | 7 | usernames = config["usernames"] |
8 | 8 | ||
9 | achieves = usernames.map do |username| | 9 | achieves = usernames.map do |username| |
@@ -18,8 +18,8 @@ achieves = usernames.map do |username| | |||
18 | end | 18 | end |
19 | end.flatten | 19 | end.flatten |
20 | 20 | ||
21 | if File.exists?("achieves.txt") | 21 | if File.exists?(config["achievements"]) |
22 | already = File.read("achieves.txt").split("\n") | 22 | already = File.read(config["achievements"]).split("\n") |
23 | all_achieves = achieves + already | 23 | all_achieves = achieves + already |
24 | else | 24 | else |
25 | all_achieves = achieves | 25 | all_achieves = achieves |
@@ -33,6 +33,6 @@ if config.key? "blacklist" | |||
33 | all_achieves.reject! { |l| blacklist.include? l } | 33 | all_achieves.reject! { |l| blacklist.include? l } |
34 | end | 34 | end |
35 | 35 | ||
36 | File.open("achieves.txt", "w") do |f| | 36 | File.open(config["achievements"], "w") do |f| |
37 | f << all_achieves.join("\n") | 37 | f << all_achieves.join("\n") |
38 | end | 38 | end |