Created
May 26, 2025 17:38
-
-
Save dewomser/7e2b67579218b018f281040b57c1ee7b to your computer and use it in GitHub Desktop.
Webseite auf neue Version prüfen. HTML vergleichen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
URL="https://blog.fefe.de" # Ersetze dies mit der gewünschten URL | |
FILE="webpage_snapshot.html" | |
stempel=$(date) | |
toot_text="Dieses Script führt täglich eine Stausabfrage durch. Da muss nicht jeder selbst klicken \n" | |
# Webseite abrufen | |
curl -s "$URL" > "new_snapshot.html" | |
# Prüfen, ob es bereits eine gespeicherte Version gibt | |
if [ -f "$FILE" ]; then | |
# Änderungen vergleichen | |
if ! diff -q "$FILE" "new_snapshot.html" >/dev/null; then | |
echo -e "$toot_text $stempel Fefes Blog hat sich vereändert!"|toot post | |
else | |
echo -e "$toot_text $stempel Fefes Blog Kein neuer Eintrag festgestellt." | toot post | |
fi | |
else | |
echo "Erstelle erste Momentaufnahme." | |
fi | |
# Neue Momentaufnahme speichern | |
mv "new_snapshot.html" "$FILE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment