diff options
author | Yves Fischer <yvesf-git@xapek.org> | 2011-12-25 19:24:56 +0100 |
---|---|---|
committer | Yves Fischer <yvesf-git@xapek.org> | 2011-12-25 19:24:56 +0100 |
commit | c5520f7ed7ca5812b87e33f83475696e3353596d (patch) | |
tree | 4f51253c784a61e61c1097f077af594dd9b5978a /abfall_spermüll/get.sh | |
parent | faf64a10d51ca7e808cdaf74cba8c31e1d61d6d6 (diff) | |
download | scripts-c5520f7ed7ca5812b87e33f83475696e3353596d.tar.gz scripts-c5520f7ed7ca5812b87e33f83475696e3353596d.zip |
sperrmüll
Diffstat (limited to 'abfall_spermüll/get.sh')
-rwxr-xr-x | abfall_spermüll/get.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/abfall_spermüll/get.sh b/abfall_spermüll/get.sh new file mode 100755 index 0000000..a689f8f --- /dev/null +++ b/abfall_spermüll/get.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +fetch_tour() { + tourId=$1 + curl "http://www.abfallwirtschaft-ortenaukreis.de/tourSearch.php?id=53&lang=de&action=showTour&muellID=8&tour=$tourId" 2>/dev/null +} + +parse_tour() { + tourId=$1 + tmp=`mktemp` + fetch_tour $tourId > "$tmp" + bereich=`sed -n -e 's/.*Bereich: \([^<]\+\).*/\1/p' < "$tmp"` + for datum in `sed -n -e 's/\s\+\w\+, \([0-9]\{2\}\)\. \(\w\+\) \([0-9]\{4\}\).*/\1.\2.\3/p' < "$tmp"`; do + python -c "import time; print time.strftime('%F', time.strptime('$datum', '%d.%B.%Y')), '$bereich'" + done + rm "$tmp" +} + +for tourId in `seq 0 9000`; do + echo tourId=$tourId >&2 + parse_tour tourId +done |