NOAA Observations v0.4.25 NOAA.Observations View Source
Fetches a list of weather observations for a US state/territory.
Link to this section Summary
Functions
Fetches weather observations for a US state
/territory
Fetches the latest observation for a given NOAA station
Fetches a list of stations for a US state
/territory
Link to this section Functions
Link to this function
fetch(state, url_templates \\ [state: "https://w1.weather.gov/xml/current_obs/seek.php?state={st}&Find=Find", station: "https://w1.weather.gov/xml/current_obs/display.php?stid={stn}"])
View Source
fetch(NOAA.Observations.CLI.state(), Keyword.t()) :: {:ok, [obs()]} | {:error, String.t()}
Fetches weather observations for a US state
/territory.
Returns a tuple of either {:ok, [obs]}
or {:error, text}
.
Parameters
state
- US state/territory codeurl_templates
- URL templates
URL templates
:state
- URL template for a state:station
- URL template for a station
Examples
alias NOAA.Observations
Observations.fetch("vt")
Link to this function
obs(station, url_templates)
View Source
obs(NOAA.Observations.CLI.stn(), Keyword.t()) :: {:ok, obs()} | {:error, String.t()}
Fetches the latest observation for a given NOAA station
.
Returns a tuple of either {:ok, obs}
or {:error, text}
.
Parameters
station
- NOAA stationurl_templates
- URL templates
Link to this function
stations(state, url_templates)
View Source
stations(NOAA.Observations.CLI.state(), Keyword.t()) :: {:ok, [NOAA.Observations.CLI.stn()]} | {:error, String.t()}
Fetches a list of stations for a US state
/territory.
Returns a tuple of either {:ok, [stn]}
or {:error, text}
.
Parameters
state
- US state/territory codeurl_templates
- URL templates