defp from_cache!(day, year), do: File.read!(cache_path(day, year))
defp download!(day, year) do
- {:ok, {{'HTTP/1.1', 200, 'OK'}, _, input}} =
+ {:ok, {{~c"HTTP/1.1", 200, ~c"OK"}, _, input}} =
:httpc.request(
:get,
- {'https://adventofcode.com/#{year}/day/#{day}/input', headers()},
+ {~c"https://adventofcode.com/#{year}/day/#{day}/input", headers()},
[],
[]
)
defp headers,
do: [
- {'user-agent', 'github.com/mhanberg/advent-of-code-elixir-starter by aoc@mitchellhanberg.com'},
- {'cookie', String.to_charlist("session=" <> Keyword.get(config(), :session_cookie))}
+ {~c"user-agent",
+ ~c"github.com/mhanberg/advent-of-code-elixir-starter by aoc@mitchellhanberg.com"},
+ {~c"cookie", String.to_charlist("session=" <> Keyword.get(config(), :session_cookie))}
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
- extra_applications: [:logger, :inets]
+ extra_applications: [:logger, :inets, :public_key, :ssl]
]
end