Packages

Page parser for weather sites

Current section

Files

Jump to
elixir_weather lib page_helper.ex
Raw

lib/page_helper.ex

defmodule ElixirWeather.PageHelper do
# Download page html
def download(url, timeout \\ 8000) do
IO.puts "Getting data from #{url}"
case HTTPoison.get(url, [], [timeout: timeout]) do
{:ok, %HTTPoison.Response{status_code: 200, body: body}} ->
body
{_,_} ->
[]
end
end
end