modified: html/style.css
modified: index.sh
This commit is contained in:
@@ -21,12 +21,12 @@ if [ ! -s "$data/atemp.data" ]; then
|
||||
fi
|
||||
|
||||
## Depth
|
||||
curl -s https://www.ag.ch/app/hydrometrie/station/?id=11626 | grep -m 9 td | tail -n 1 | grep -Eo '[0-9][0-9][0-9].[0-9][0-9]' | awk '{print $1-398}' > "$data"/depth.data
|
||||
curl -s --user-agent "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/538.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36" https://www.hydrodaten.admin.ch/de/seen-und-fluesse/stationen-und-daten/2099#stationsinfos | grep -A 8 -m 1 'Letzter' | tail -n 1 | grep -Eo '[0-9][0-9][0-9].[0-9][0-9]' | awk '{print $1-398}' > "$data"/depth.data
|
||||
|
||||
if [ ! -s "$data/depth.data" ]; then
|
||||
echo "$(date): depth empty, wait a minute or something" >> /tmp/error.log
|
||||
sleep 30
|
||||
curl -s https://www.ag.ch/app/hydrometrie/station/?id=11626 | grep -m 9 td | tail -n 1 | grep -Eo '[0-9][0-9][0-9].[0-9][0-9]' | awk '{print $1-398}' > "$data"/depth.data
|
||||
curl -s --user-agent "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/538.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36" https://www.hydrodaten.admin.ch/de/seen-und-fluesse/stationen-und-daten/2099#stationsinfos | grep -A 8 -m 1 'Letzter' | tail -n 1 | grep -Eo '[0-9][0-9][0-9].[0-9][0-9]' | awk '{print $1-398}' > "$data"/depth.data
|
||||
fi
|
||||
|
||||
## Discharge
|
||||
@@ -191,18 +191,18 @@ echo -e "<!DOCTYPE html>
|
||||
<h5>ℹ</h5>
|
||||
</div>
|
||||
<span class=\"popuptext\" id=\"infopop\">
|
||||
<p class=emo><a href=https://www.openstreetmap.org/#map=17/47.39157/8.52349 target=_blank>🗺</a> <a href=mailto:[email protected]>📧</a></p>
|
||||
<p class=emo><a href=https://www.openstreetmap.org/#map=17/47.39157/8.52349 rel=\"noopener\" target=_blank>🗺</a> <a href=mailto:[email protected]>📧</a></p>
|
||||
<div class=text><p>Made with bash. No cookies, no bullshit.</p></div>
|
||||
<div class=text><p>Updated every 20 minutes, curves show past week.</p></div>
|
||||
<div class=sources><p>Using open data from:</p></div>
|
||||
<div class=sources><a href=https://ag.ch target=_blank>ag.ch</a> <a href=https://wetteronline.ch target=_blank>wetteronline.ch</a> <a href=https://wttr.in target=_blank>wttr.in</a> <a href=https://zh.ch target=_blank>zh.ch</a></div>
|
||||
<div class=sources><a href=https://admin.ch rel=\"noopener\" target=_blank>admin.ch</a> <a href=https://wetteronline.ch rel=\"noopener\" target=_blank>wetteronline.ch</a> <a href=https://wttr.in rel=\"noopener\" target=_blank>wttr.in</a> <a href=https://zh.ch rel=\"noopener\" target=_blank>zh.ch</a></div>
|
||||
<div class=text><p>Thank you!</ul></div>
|
||||
</span>
|
||||
</div>
|
||||
<div class=current>
|
||||
<p class=update>Updated at ${utime}</p>
|
||||
<p class=wttr>$wttr</p>
|
||||
<p class=danger>Danger Level</p>
|
||||
<p class=danger><a href=\"https://www.hydrodaten.admin.ch/de/die-5-gefahrenstufen-fuer-hochwasser\" rel=\"noopener\" target=_blank>Danger Level</a></p>
|
||||
<p class=level style=\"${dangr} / 5</p>
|
||||
</div>
|
||||
<div class=cat>
|
||||
@@ -227,7 +227,7 @@ echo -e "<!DOCTYPE html>
|
||||
</div>
|
||||
</div>
|
||||
<div class=footer>
|
||||
<p>Gmacht mit <a href="https://6bit.ch">🔮</a> z'Züri.</p>
|
||||
<p>Gmacht mit <a href="https://6bit.ch" rel=\"noopener\" target=_blank>🔮</a> z'Züri.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>" > /var/www/hardbrugg.ch/html/index.html
|
||||
|
||||
Reference in New Issue
Block a user