Skip to content
Snippets Groups Projects
Select Git revision
  • b070ebaa5ee94a6662b2db1f169088a69cb27ecd
  • inf4_40 default protected
2 results

SemaChecking.cpp

Blame
  • hunger-fetch.sh 1.17 KiB
    #!/bin/zsh
    
    # run once a day by cronjob, to avoid
    # flooding werkswelt with requests
    
    set -eu
    
    PATH=/usr/local/bin:/usr/bin:/bin:/usr/games
    export PATH
    
    cd /home/cip/adm/im72ywil-roadkill/proj/hunger/
    
    (
    	echo '<html><head><title>Hunger</title><meta http-equiv="content-type" content="text/html; charset=utf-8"></meta></head><body>'
    
    	lynx -nolist --dump -width=1024 "http://www.werkswelt.de/" |
    	awk '$0 ~ /\<(geschlossen|(ge|)öffnet|(ge|)oeffnet|offen|schliesst|schließt)\>/ && $0 ~ "Mensa|Mensen|Cafeteria|Cafeterien|Cafebar" {a= "<li>" $0 "</li></br>"} /Gastronomie/{if (!p && a!=""){print "<h2><i>Wichtig</i></h2><ul>"} if (a!=""){print a; a=""; p=1}}END{if (p) {print "</ul>"}}'
    	echo "</ul>"
    
    	echo '<h3>Mensa</h3>'
    	xmllint --html --xpath '//table[@class="oeffnungszeiten"]' "http://www.werkswelt.de/index.php?id=sued" 2>/dev/null
    
    	echo '<h3>Cafete</h3>'
    	xmllint --html --xpath '//table[@class="oeffnungszeiten"]' "http://www.werkswelt.de/index.php?id=cafeteria-suedmensa-erlangen" 2>/dev/null
    
    	echo '<h3>Cafebar</h3>'
    	xmllint --html --xpath '//table[@class="oeffnungszeiten"]' "http://www.werkswelt.de/index.php?id=cafebar-suedmensa" 2>/dev/null
    	echo '</body></html>'
    ) >hungerraw.html