Merge branch 'xmllint'

This commit is contained in:
Pavol Rusnak 2013-06-03 21:23:07 +02:00
commit 2eec25ba85
2 changed files with 16 additions and 4 deletions

View file

@ -1,11 +1,24 @@
HAML=haml
XMLLINT=xmllint
# option #!
DATAURL=http://hydro.chmi.cz/hpps/popup_hpps_prfdyn.php?seq=307225A
IMGURL1=http://hydro.chmi.cz/hpps/tmp/img/big/307225_H.png
IMGURL2=http://hydro.chmi.cz/hpps/tmp/img/big/307225_Q.png
DATAPATH=//table[@class="stdstationtbl"]/./tr[3]//table/tr[position()>1]
# oprion #2
#DATAURL=http://vvv.chmi.cz/hydro/detail_stanice/307225.html
#IMGURL1=http://vvv.chmi.cz/hydro/graph/big/307225_H.png
#IMGURL2=http://vvv.chmi.cz/hydro/graph/big/307225_Q.png
#DATAPATH=//table[2]//tr[3]/td//table//tr[position()>1]
all: index.html doprava.html pomoc.html
refresh:
curl 'http://hydro.chmi.cz/hpps/popup_hpps_prfdyn.php?seq=307225' | sed -n '154,333 p' > data/table.html
wget 'http://hydro.chmi.cz/hpps/tmp/img/big/307225_H.png' -O data/stav.png
wget 'http://hydro.chmi.cz/hpps/tmp/img/big/307225_Q.png' -O data/prutok.png
wget '$(IMGURL1)' -O data/stav.png
wget '$(IMGURL2)' -O data/prutok.png
wget '$(DATAURL)' -O - | $(XMLLINT) --html --encode utf8 - | $(XMLLINT) --html --xpath '$(DATAPATH)' - > data/table.html
%.html: %.haml
$(HAML) $< $@