mirror of
https://github.com/brmlab/povoden.git
synced 2025-06-07 09:44:02 +02:00
fix query and add road map
This commit is contained in:
parent
48b49c9fd2
commit
0f030013ae
7 changed files with 59 additions and 6 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,3 +2,4 @@ doprava.html
|
|||
index.html
|
||||
kontakty.html
|
||||
pomoc.html
|
||||
cesty.html
|
||||
|
|
36
Makefile
36
Makefile
|
@ -25,8 +25,33 @@ DOPRAVAURL=http://www.dpp.cz/povodne-aktualni-doprava/
|
|||
DOPRAVATMP=/tmp/doprava.html
|
||||
DOPRAVAXPATH1=string((//div[@id="content-container"]/div[@id="pole"]/div/div[2]//a[starts-with(@title,"Stav dopravy k")]/@href)[last()])
|
||||
DOPRAVAXPATH2=//div[@id="content-container"]/div[@id="pole"]/div/div[2]//*[@class="img-c img-envelope"]/../preceding-sibling::*
|
||||
DOPRAVAXPATH3=//div[@id="pole"]//*[starts-with(text(),"Stav městské")]/following-sibling::*
|
||||
|
||||
CESTYURL=http://www.praha.eu/jnp/cz/home/magistrat/tiskovy_servis/tiskove_zpravy/prehled_uzavrenych_komunikaci.html
|
||||
CESTYXPATH=string(//div[@id="content"]//a[text() = "Mapka"]/@href)
|
||||
|
||||
# function
|
||||
get-doprava = \
|
||||
echo ; echo Doprava ; \
|
||||
wget $(DOPRAVAURL) -O - | $(XMLLINT) --encode utf8 - > $(DOPRAVATMP) ; \
|
||||
wget $$($(XMLLINT) --html --xpath '$(DOPRAVAXPATH1)' $(DOPRAVATMP)) -O - | convert -density 150 - data/doprava_.png && mogrify -resize 1200x1200 data/doprava_.png ; \
|
||||
$(XMLLINT) --xpath '$(DOPRAVAXPATH2)' $(DOPRAVATMP) > data/doprava_.html ; \
|
||||
mv data/doprava_.png data/doprava.png && mv data/doprava_.html data/doprava.html ; \
|
||||
rm $(DOPRAVATMP) ; \
|
||||
|
||||
get-doprava-noimg = \
|
||||
echo ; echo Doprava ; \
|
||||
wget $(DOPRAVAURL) -O - | $(XMLLINT) --encode utf8 - > $(DOPRAVATMP) ; \
|
||||
$(XMLLINT) --xpath '$(DOPRAVAXPATH3)' $(DOPRAVATMP) > data/doprava_.html ; \
|
||||
echo "Doprava byla obnovena." | convert -background none -undercolor lightblue -fill blue -pointsize 18 text:- -trim +repage -bordercolor lightblue -page 1200x95+500+10 -background lightblue -flatten data/doprava_.png ; \
|
||||
mv data/doprava_.png data/doprava.png && mv data/doprava_.html data/doprava.html ; \
|
||||
rm $(DOPRAVATMP) ; \
|
||||
|
||||
get-cesty = \
|
||||
echo ; echo Cesty ; \
|
||||
wget $$($(XMLLINT) --xpath '$(CESTYXPATH)' $(CESTYURL)) -O - | convert -density 150 - data/cesty_.png && mogrify -resize 1500x1500 data/cesty_.png ; \
|
||||
mv data/cesty_.png data/cesty.png ; \
|
||||
|
||||
get-voda = \
|
||||
echo; echo *Station $(STATION)* ; \
|
||||
wget '$(VODAIMG1)' -O data/stav_$(STATION).png_; \
|
||||
|
@ -38,18 +63,17 @@ $(XMLLINT) --xpath '$(VODANAMESXPATH)' $(VODATMP) > data/name_$(STATION).html_;
|
|||
$(foreach FILE,stav_$(STATION).png prutok_$(STATION).png table_$(STATION).html name_$(STATION).html legend_$(STATION).html,mv -v data/$(FILE)_ data/$(FILE);) \
|
||||
rm $(VODATMP);
|
||||
|
||||
all: index.html doprava.html pomoc.html kontakty.html
|
||||
all: index.html doprava.html pomoc.html kontakty.html cesty.html
|
||||
|
||||
refresh:
|
||||
$(foreach STATION,$(VODASTATIONS), $(call get-voda) )
|
||||
sed -i 's/@stations\s*=.*/@stations=[$(foreach STATION,$(VODASTATIONS), $(STATION)\, )]/' index.haml
|
||||
|
||||
refreshdpp:
|
||||
wget $(DOPRAVAURL) -O - | $(XMLLINT) --encode utf8 - > $(DOPRAVATMP)
|
||||
wget $$($(XMLLINT) --html --xpath '$(DOPRAVAXPATH1)' $(DOPRAVATMP)) -O - | convert -density 150 - data/doprava_.png && mogrify -resize 1200x1200 data/doprava_.png
|
||||
$(XMLLINT) --xpath '$(DOPRAVAXPATH2)' $(DOPRAVATMP) > data/doprava_.html
|
||||
mv data/doprava_.png data/doprava.png && mv data/doprava_.html data/doprava.html
|
||||
rm $(DOPRAVATMP)
|
||||
$(call get-doprava-noimg)
|
||||
|
||||
refreshcesty:
|
||||
$(call get-cesty)
|
||||
|
||||
%.html: %.haml
|
||||
$(HAML) $< $@
|
||||
|
|
24
cesty.haml
Normal file
24
cesty.haml
Normal file
|
@ -0,0 +1,24 @@
|
|||
!!! 5
|
||||
%html
|
||||
%head
|
||||
%meta(charset="utf-8")
|
||||
%link(rel="icon" type="image/png" href="favicon.png")
|
||||
%link(rel="stylesheet" type="text/css" href="style.css")
|
||||
%title Povodeň - Doprava
|
||||
%body
|
||||
|
||||
%ul#navbar
|
||||
%li.logo
|
||||
%li <a href='index.html'>Voda</a>
|
||||
%li <a href='doprava.html'>Doprava</a>
|
||||
%li.active <a href='cesty.html'>Cesty</a>
|
||||
%li <a href='pomoc.html'>Nabídky pomoci</a>
|
||||
%li <a href='kontakty.html'>Kontakty</a>
|
||||
|
||||
.content
|
||||
|
||||
#imgdoprava
|
||||
%img(src="data/cesty.png" style="width: 100%; max-width: 1500px;")
|
||||
|
||||
%hr
|
||||
.footer Data poskytuje Magistrát hl. m. Prahy. Bez záruky.
|
|
@ -11,6 +11,7 @@
|
|||
%li.logo
|
||||
%li <a href='index.html'>Voda</a>
|
||||
%li.active <a href='doprava.html'>Doprava</a>
|
||||
%li <a href='cesty.html'>Cesty</a>
|
||||
%li <a href='pomoc.html'>Nabídky pomoci</a>
|
||||
%li <a href='kontakty.html'>Kontakty</a>
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
%li.logo
|
||||
%li.active <a href='index.html'>Voda</a>
|
||||
%li <a href='doprava.html'>Doprava</a>
|
||||
%li <a href='cesty.html'>Cesty</a>
|
||||
%li <a href='pomoc.html'>Nabídky pomoci</a>
|
||||
%li <a href='kontakty.html'>Kontakty</a>
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
%li.logo
|
||||
%li <a href='index.html'>Voda</a>
|
||||
%li <a href='doprava.html'>Doprava</a>
|
||||
%li <a href='cesty.html'>Cesty</a>
|
||||
%li <a href='pomoc.html'>Nabídky pomoci</a>
|
||||
%li.active <a href='kontakty.html'>Kontakty</a>
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
%li.logo
|
||||
%li <a href='index.html'>Voda</a>
|
||||
%li <a href='doprava.html'>Doprava</a>
|
||||
%li <a href='cesty.html'>Cesty</a>
|
||||
%li.active <a href='pomoc.html'>Nabídky pomoci</a>
|
||||
%li <a href='kontakty.html'>Kontakty</a>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue