Created
January 5, 2016 15:08
-
-
Save tatut/ed62980ef59c7ab13979 to your computer and use it in GitHub Desktop.
Bitbar plugin to fetch weather (air and road temps) from Finnish Transport Agency weather camera
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # To change the station, go to http://liikennetilanne.liikennevirasto.fi/ | |
| # and open the network inspector when clicking a weather camera. | |
| # Copy the URL below. | |
| curl -s "https://services1.arcgis.com/rhs5fjYxdOG1Et61/ArcGIS/rest/services/RWS_station/FeatureServer/0/query?f=json&where=NUMERO%3D13008&returnGeometry=false&spatialRel=esriSpatialRelIntersects&outFields=windSpeed%2CwindDirection%2CTSA_NIMI%2CmeasurementTime%2CairTemperature%2CroadTemperature%2CroadSurfaceCondition" | /usr/local/bin/jq -r "\"Ilma: \\(.features[0].attributes.airTemperature), Tie: \\(.features[0].attributes.roadTemperature)\"" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Requires jq tool (brew install it).