Minor cleanup
This commit is contained in:
parent
faff51b9d3
commit
57715c25ee
1 changed files with 3 additions and 3 deletions
|
@ -40,14 +40,14 @@ end
|
|||
|
||||
local = Dir
|
||||
.entries(".")
|
||||
.select { |entry| File.directory?(entry) && !entry.match?(/^\./) }
|
||||
.select { File.directory?(_1) && !_1.match?(/^\./) }
|
||||
|
||||
browser.goto("https://adventofcode.com/")
|
||||
cookies = JSON.parse(File.read("tmp/cookies.json"))
|
||||
cookies.each { |cookie| browser.cookies.add(cookie["name"], cookie["value"], domain: cookie["domain"]) }
|
||||
cookies.each { browser.cookies.add(_1["name"], _1["value"], domain: _1["domain"]) }
|
||||
pre_element = browser.element(tag_name: "pre", class: "calendar")
|
||||
doc = Nokogiri::HTML(pre_element.html)
|
||||
links = doc.css("a").map { |link| link["href"] }
|
||||
links = doc.css("a").map { _1["href"] }
|
||||
|
||||
available = links.map { _1.scan(/day\/(\d+)/) }.flatten.map { "%02d" % _1 }
|
||||
|
||||
|
|
Loading…
Reference in a new issue