uhlig-it / tankerkoenig-exporter

Exports Tankerkönig data for Prometheus

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tankerkönig Exporter

Exports Tankerkönig data for Prometheus

Build

$ goreleaser --snapshot

Deployment

$ cd deployment
$ ansible-playbook playbook.yml -i somewhere.example.com,

Manual Approach

  1. Search for a station within 1 km of my home:

    $ curl "https://creativecommons.tankerkoenig.de/json/list.php?lat=48.52&lng=8.82&rad=1&sort=dist&type=all&apikey=$TANKERKOENIG_API_KEY" | jq -r '.stations[].id'
    870efffb-676b-4301-854e-c80e93c3e3ef
  2. For that station, get the current price of Diesel:

    $ TANKERKOENIG_STATIONS=870efffb-676b-4301-854e-c80e93c3e3ef
    $ curl "https://creativecommons.tankerkoenig.de/json/prices.php?ids=$TANKERKOENIG_STATIONS&apikey=$TANKERKOENIG_API_KEY" | jq -r '.prices[].diesel'

Ideas

  • Concourse resource creates a new version when the price has change (risen/fallen)

Links

About

Exports Tankerkönig data for Prometheus


Languages

Language:Go 100.0%