Hello, I am looking for help creating a command that retrieves info from a website. Id like a command to fetch river data from
Monitoring location 03075070 is associated with a Stream in Allegheny County, Pennsylvania. Current conditions of Gage height, Specific conductance, Stream water level elevation above NAVD 1988, and more are available. Water data back to 1933 are...
Now there are several categories of info. Id like the command to display gauge as well as temperatures. If this isn’t possible as a one command thing I’m ok with making two commands.
Can anyone help!?!?
Thanks in advance!!
Try:
$(eval try { const data = $(urlfetch json https://waterservices.usgs.gov/nwis/iv/?sites=03075070&agencyCd=USGS¶meterCd=00010,00065&format=json); const siteName = data.value.timeSeries[0].sourceInfo.siteName; const temperature = data.value.timeSeries[0].values[0].value[0].value; const riverHeight = data.value.timeSeries[1].values[0].value[0].value; "Site: " + siteName + " | Temperature: " + temperature + "°C | River Height: " + riverHeight + " ft"; } catch (e) { "Error fetching data"; })
system
Closed
December 27, 2024, 2:10pm
4
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.