mirror of
https://github.com/brmlab/povoden.git
synced 2025-06-08 10:14:20 +02:00
link to hydrostation
This commit is contained in:
parent
f39db619ec
commit
cf7a2c0207
3 changed files with 15 additions and 3 deletions
9
Makefile
9
Makefile
|
@ -10,7 +10,9 @@ VODASTATIONS=307225 307081 307228
|
|||
VODAURL=http://hydro.chmi.cz/hpps/popup_hpps_prfdyn.php?seq=$(STATION)
|
||||
VODAIMG1=http://hydro.chmi.cz/hpps/tmp/img/big/$(STATION)_H.png
|
||||
VODAIMG2=http://hydro.chmi.cz/hpps/tmp/img/big/$(STATION)_Q.png
|
||||
VODATMP=/tmp/voda.html
|
||||
VODAXPATH=//table[@class="stdstationtbl"]/./tr[3]//table/tr[position()>1]
|
||||
VODANAMESXPATH=//table[@class="stdstationtbl"]/./tr[1]//table/./tr[2]/td/text()
|
||||
|
||||
# option #2
|
||||
#VODAURL=http://vvv.chmi.cz/hydro/detail_stanice/$(STATION).html
|
||||
|
@ -28,8 +30,11 @@ get-voda = \
|
|||
echo; echo *Station $(STATION)* ; \
|
||||
wget '$(VODAIMG1)' -O data/stav_$(STATION).png_; \
|
||||
wget '$(VODAIMG2)' -O data/prutok_$(STATION).png_; \
|
||||
wget '$(VODAURL)' -O - | $(XMLLINT) --encode utf8 - | $(XMLLINT) --xpath '$(VODAXPATH)' - > data/table_$(STATION).html_; \
|
||||
$(foreach FILE,data/stav_$(STATION).png data/prutok_$(STATION).png data/table_$(STATION).html,mv -v $(FILE)_ $(FILE);)
|
||||
wget '$(VODAURL)' -O - | $(XMLLINT) --encode utf8 - > $(VODATMP); \
|
||||
$(XMLLINT) --xpath '$(VODAXPATH)' $(VODATMP) > data/table_$(STATION).html_; \
|
||||
$(XMLLINT) --xpath '$(VODANAMESXPATH)' $(VODATMP) > data/name_$(STATION).html_; \
|
||||
$(foreach FILE,stav_$(STATION).png prutok_$(STATION).png table_$(STATION).html name_$(STATION).html,mv -v data/$(FILE)_ data/$(FILE);) \
|
||||
rm $(VODATMP);
|
||||
|
||||
all: index.html doprava.html pomoc.html kontakty.html
|
||||
|
||||
|
|
1
data/.gitignore
vendored
1
data/.gitignore
vendored
|
@ -3,3 +3,4 @@ doprava*.png
|
|||
prutok*.png
|
||||
stav*.png
|
||||
table*.html
|
||||
name*.html
|
||||
|
|
|
@ -19,8 +19,14 @@
|
|||
%li <a href='kontakty.html'>Kontakty</a>
|
||||
|
||||
.content
|
||||
%p
|
||||
- @stations.each do |station|
|
||||
%a(href="##{station}")
|
||||
=File.read("data/name_#{station}.html")
|
||||
%br
|
||||
|
||||
- @stations.each do |station|
|
||||
%hr(id="#{station}")
|
||||
%table.twocolumn
|
||||
%tr
|
||||
%td(style="padding: 16px;")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue