about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-02-23 09:54:45 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2018-02-23 09:54:45 -0500
commit4a8bd6d2bafe9bbbb4c43f06a351fa67b0616699 (patch)
treef9e79f41399b92319e56b429dd71f2d04d616bd5
parentb77ab7cb283e64fb8b23f4892115644e84596842 (diff)
downloadlunatic-4a8bd6d2bafe9bbbb4c43f06a351fa67b0616699.tar.gz
lunatic-4a8bd6d2bafe9bbbb4c43f06a351fa67b0616699.tar.bz2
lunatic-4a8bd6d2bafe9bbbb4c43f06a351fa67b0616699.zip
Scraper uses config-defined achievements list
-rw-r--r--scrape.rb8
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'
3require 'open-uri' 3require 'open-uri'
4require 'yaml' 4require 'yaml'
5 5
6config = YAML.load(open("config.yml")) 6config = YAML.load(open("lunatic/config.yml"))
7usernames = config["usernames"] 7usernames = config["usernames"]
8 8
9achieves = usernames.map do |username| 9achieves = usernames.map do |username|
@@ -18,8 +18,8 @@ achieves = usernames.map do |username|
18 end 18 end
19end.flatten 19end.flatten
20 20
21if File.exists?("achieves.txt") 21if 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
24else 24else
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 }
34end 34end
35 35
36File.open("achieves.txt", "w") do |f| 36File.open(config["achievements"], "w") do |f|
37 f << all_achieves.join("\n") 37 f << all_achieves.join("\n")
38end 38end