fix get_input

This commit is contained in:
Caleb Webber 2024-11-10 19:37:49 -05:00
parent 857a26892e
commit 892759da6c
2 changed files with 3 additions and 5 deletions

View file

@ -3,9 +3,11 @@ defmodule AoC do
defp get_request_headers!(), do: [Cookie: "session=#{get_session!()}"]
def fetch_input!(year, day) do
Application.ensure_all_started(:req)
Req.get!(
"https://adventofcode.com/#{year}/day/#{day}/input",
get_request_headers!()
headers: get_request_headers!()
)
|> Map.get(:body)
end

View file

@ -4,10 +4,6 @@ defmodule Mix.Tasks.GetInput do
write_file = &File.write("./input/#{year}_#{day}.txt", &1)
AoC.fetch_input!(year, day)
|> then(fn i ->
IO.puts(i)
i
end)
|> write_file.()
end
end