Add Github Action

pull/16/head
Pierre Mesure 2022-01-26 20:30:01 +01:00
rodzic 715e3cfe89
commit 8518e8121f
2 zmienionych plików z 34 dodań i 1 usunięć

Wyświetl plik

@ -0,0 +1,24 @@
name: Update data
on:
workflow_dispatch:
schedule:
- cron: '15 0 * * *'
jobs:
scrape:
name: Update data
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
wget -O data-full.json https://lz4.overpass-api.de/api/interpreter\?data\=%0A%09%09%09%5Bout%3Ajson%5D%5Btimeout%3A200%5D%3B%0A%09%09%09%2F%2F%20gather%20results%0A%09%09%09\(%0A%09%09%09%20%20%2F%2F%20query%20part%20for%3A%20%E2%80%9C%22seamark%3Alight%3Asequence%22%3D\*%E2%80%9D%0A%09%09%09%20%20node%5B%22seamark%3Alight%3Asequence%22%5D\(-90%2C-180%2C90%2C180\)%3B%0A%09%09%09%20%20way%5B%22seamark%3Alight%3Asequence%22%5D\(-90%2C-180%2C90%2C180\)%3B%0A%09%09%09\)%3B%0A%09%09%09%2F%2F%20print%20results%0A%09%09%09out%20body%3B%0A%09%09%09%3E%3B%0A%09%09%09out%20skel%20qt%3B%0A%09%09
- name: Commit the data
uses: nick-invision/retry@v2
with:
timeout_seconds: 10
max_attempts: 5
command: |
git config --global user.name 'Pierre Mesure (Github Actions)'
git config --global user.email 'pierre@mesu.re'
git add data-full.json
git commit -am "Updating the data"
git push

Wyświetl plik

@ -1,3 +1,12 @@
# THIS IS A FORK
I did not create this code, the original source is [here](https://github.com/geodienst/lighthousemap) and the map [here](https://geodienst.github.io/lighthousemap/).
Like many others, I learnt about this beautiful gem of data visualisation thanks to this [viral tweet](https://twitter.com/emollick/status/1485467613190832130). I love it! This is such a great example of what can be accomplished with OpenStreetMap and crowdsourced data!
But I was equally disappointed as many others to see that the data hadn't been updated in 3 years.
So I dug in the code and found the Overpass query to fetch up-to-date data. And while I was at it, I added a Github Action to keep it updated. It runs every day at 00:15 CET for now, and I might make it update less often later to use even less energy.
# Beacon map
This map shows all the blinking beacons from [OpenStreetMap](https://www.openstreetmap.org/).
@ -14,4 +23,4 @@ The `leaflet.indexedfeaturelayer.js` file contains an extension on Leaflet's Geo
`leaflet.light.js` contains my best guess on how a light sequence will look based on [these descriptions](https://wiki.openstreetmap.org/wiki/Seamarks/Light_Characters). However, it might be inaccurate, and it tries to do its best with the sometimes not entirely consistent data from OSM.
## Credits
This map is made by the [Geodienst](https://www.geodienst.xyz) because it was a fun idea we wanted to try out. Feel free to fork this map and make your own visualisation of OSM data, or contribute improvements back to us.
This map is made by the [Geodienst](https://www.geodienst.xyz) because it was a fun idea we wanted to try out. Feel free to fork this map and make your own visualisation of OSM data, or contribute improvements back to us.