Skip to content

Instantly share code, notes, and snippets.

@NWuensche
Created February 19, 2019 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NWuensche/978df622a121d6f2173d917a90422995 to your computer and use it in GitHub Desktop.
Save NWuensche/978df622a121d6f2173d917a90422995 to your computer and use it in GitHub Desktop.
#!/bin/sh
MARKT_LAST_CHANGE=$(wget -q -O- https://wo-ist-markt.de/cities/berlin.json | sed -n 's/.*aktualisiert am \(.*\)",/\1/p')
BERLIN_LAST_CHANGE=$(wget -q -O- https://daten.berlin.de/datensaetze/wochen-und-tr%C3%B6delm%C3%A4rkte-0 | sed -n '/.*Aktualisiert.*/,$p' | sed -e '/.*end.*/,$d' | sed -n 's/.*<span .*>\(.*\)<\/span.*/\1/p')
if [[ "$MARKT_LAST_CHANGE" != "$BERLIN_LAST_CHANGE" ]]; then
echo "Dates don't match!"
#TODO Send E-Mail here
exit 1;
fi
#cronjob: 0 20 * * * ./markt_date_berlin.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment