Last active
January 24, 2016 15:50
-
-
Save concHNO3/8fb7c1f1dafab7862ae9 to your computer and use it in GitHub Desktop.
Shelscript um die Nachrichten von ard-text.de regelmässig abzufragen und mir neue oder geänderte Artikle zu zusenden.
This file contains 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
#!/usr/bin/zsh | |
#Skript um kurze Nachrichten an eine Emailadresse zu senden | |
#benötigt ein konfigurertes ssmtp | |
#Change ME: | |
EMAIL="[email protected]" | |
#properbly don't change me: | |
PFAD=$(dirname $0); | |
for i in $(seq 106 149) | |
do | |
w3m -dump http://ard-text.de/mobil/$i|sed '1,/• Weiter/d;/• Zurück/,$d;1,2d;'>$PFAD"/temp.txt" | |
MD5=$(md5sum $PFAD"/temp.txt|awk '{print $1}'); | |
if [ $MD5 != "4f705c8aed7fe598d039105b4d781057" ] | |
then | |
if grep -Fxq "$MD5" $PFAD"/Archiv.txt | |
then | |
else | |
cat $PFAD"/temp.txt| mail -s "$(cat $PFAD"/temp.txt | sed -n '1p;3p' |sed ':a;N;$!ba;s/\n/ - /g') - Page $i" $EMAIL | |
echo $MD5 >> $PFAD"/Archiv.txt | |
sleep 15 | |
#echo $i - $MD5 | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment