Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- link="http://derstandard.at/anzeiger/immoweb/Suchergebnis.aspx?FromAgentStatic=106029"
- archive="immo_archive"
- message_header="Neue Wohnung"
- message_body=""
- mail="philipp.p.thaller@icloud.com"
- wget --quiet $link -O index.html
- grep --extended-regex --only-matching InseratID=[0-9]* index.html | grep --extended-regex --only-matching [0-9]* | awk '!x[$0]++' > current_immos
- while read i
- do
- #echo -e $i\n
- if [ -z "`cat $archive | grep $i`" ]
- then
- message_body="$message_body""http://derstandard.at/anzeiger/immoweb/Detail.aspx?InseratID=$i "
- echo $i >> immo_archive
- fi
- done < current_immos
- rm index.html
- rm current_immos
- if [ -n "$message_body" ]
- then
- echo $message_body | mail -s "$message_header" $mail
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement