NOAA.Observations.URLTemplates (NOAA Observations v0.4.33) View Source
Returns a URL based on url_templates
and station
or state
.
Link to this section Summary
Functions
Returns a URL based on url_templates
and station
or state
.
Link to this section Functions
Specs
Returns a URL based on url_templates
and station
or state
.
Parameters
url_templates
- keyword of EEx stringskeyword
- [station:station
] or [state:state
]
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"