Merge branch 'master' into xmllint

Conflicts:
	Makefile
This commit is contained in:
Peter Boráros 2013-06-03 19:54:50 +02:00
commit e1784c741f
8 changed files with 48 additions and 25 deletions

View file

@ -1,24 +1,22 @@
HAML=haml
XMLLINT=xmllint
DATAPATH=//table[@class="stdstationtbl"]/./tr[3]//table/tr[position()>1]
all: index.html doprava.html
get:
curl 'http://vvv.chmi.cz/hydro/detail_stanice/307225.html' > data/307225.html
wget 'http://vvv.chmi.cz/hydro/graph/big/307225_H.png' -O data/stav.png
wget 'http://vvv.chmi.cz/hydro/graph/big/307225_Q.png' -O data/prutok.png
refresh:
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
$(XMLLINT) --html --encode utf8 http://hydro.chmi.cz/hpps/popup_hpps_prfdyn.php?seq=307225 --output data/307225.html
$(XMLLINT) --html --xpath '$(DATAPATH)' data/307225.html > data/table.html
scrap: get
xmllint --html --encode utf8 data/307225.html --output data/307225.html
xmllint --html --xpath '//div[@class="box"]/div[@class="cont"]/p[2]/text()' data/307225.html > data/timestamp.html
xmllint --html --xpath '//div[@class="box"]/div[@class="cont"]/table[2]//table[5]/tr[position()>1]' data/307225.html > data/table.html
# xmllint --html --xpath '//div[@class="box"]/div[@class="cont"]/table[2]//table[3]//tr' data/307225.html | iconv -f cp1250 -t utf8 > data/legend.html
# xmllint --html --xpath '//div[@class="box"]/div[@class="cont"]/table[2]//table[1]//tr' data/307225.html | iconv -f cp1250 -t utf8 > data/info.html
refresh: get scrap
%.html: %.haml
$(HAML) $< $@
clean:
rm -f *.html
fail:
false