Skip to content

Instantly share code, notes, and snippets.

@tatut
Created January 5, 2016 15:08
Show Gist options
  • Select an option

  • Save tatut/ed62980ef59c7ab13979 to your computer and use it in GitHub Desktop.

Select an option

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
#!/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)\""
@tatut
Copy link
Author

tatut commented Jan 5, 2016

Requires jq tool (brew install it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment