View Source NOAA.Observations.URLTemplates (NOAA Observations v0.4.57)
Returns a URL based on URL templates and a station ID or state code.
Summary
Functions
Returns a URL based on url_templates
and a station id
or state code
.
Functions
Returns a URL based on url_templates
and a station id
or state code
.
Parameters
url_templates
- keyword of EEx stringsoptions
- [station:id
] or [state:code
]
Examples
iex> alias NOAA.Observations.URLTemplates
iex> url_templates = [
...> state: "w1.weather.gov/seek.php?state=<%=state%>&Find=Find",
...> station: "w1.weather.gov/display.php?stid=<%=station%>"
...> ]
iex> {URLTemplates.url(url_templates, state: "vt"),
...> URLTemplates.url(url_templates, station: "KBTV")}
{"w1.weather.gov/seek.php?state=vt&Find=Find",
"w1.weather.gov/display.php?stid=KBTV"}
iex> alias NOAA.Observations.URLTemplates
iex> url_templates = [
...> state: "weather.gc.ca/forecast/canada/index_e.html?id=<%=state%>"
...> ]
iex> URLTemplates.url(url_templates, state: "qc")
"weather.gc.ca/forecast/canada/index_e.html?id=qc"