Advertisement
Guest User

Untitled

a guest
Aug 27th, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.80 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. link="http://derstandard.at/anzeiger/immoweb/Suchergebnis.aspx?FromAgentStatic=106029"
  4. archive="immo_archive"
  5. message_header="Neue Wohnung"
  6. message_body=""
  7. mail="philipp.p.thaller@icloud.com"
  8.  
  9. wget --quiet $link -O index.html
  10. grep --extended-regex --only-matching InseratID=[0-9]* index.html | grep --extended-regex --only-matching [0-9]* | awk '!x[$0]++' > current_immos
  11.  
  12. while read i
  13. do
  14.         #echo -e $i\n
  15.         if [ -z  "`cat $archive | grep $i`" ]
  16.         then
  17.                 message_body="$message_body""http://derstandard.at/anzeiger/immoweb/Detail.aspx?InseratID=$i "
  18.                 echo $i >> immo_archive
  19.         fi
  20.  
  21. done < current_immos
  22.  
  23. rm index.html
  24. rm current_immos
  25.  
  26. if [ -n "$message_body" ]
  27. then
  28.         echo $message_body | mail -s "$message_header" $mail
  29. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement