diff --git a/.gitignore b/.gitignore index e8f01a9..2d19fc7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -tmp/ -index.html +*.html diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..594527a --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +HAML=haml + +all: index.html doprava.html + +refresh: + curl 'http://vvv.chmi.cz/hydro/detail_stanice/307225.html' | sed -n '153,302 p' > data/table.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 + +%.html: %.haml + $(HAML) $< $@ + +clean: + rm -f *.html diff --git a/README b/README index 16c86cd..37658e3 100644 --- a/README +++ b/README @@ -1,6 +1 @@ -Very simple script that mirrors CHMI page for Prague. - -Call refre.sh script every 10 minutes. - -Only HTML page and two charts are downloaded. -Other resources are used from the local copy. +Aggregator page for various information sources deployed on http://povoden.brmlab.cz/ diff --git a/TODO b/TODO new file mode 100644 index 0000000..95e8c57 --- /dev/null +++ b/TODO @@ -0,0 +1,2 @@ +* http://www.dpp.cz/povodne-aktualni-doprava/ + diff --git a/css/media_style.css b/css/media_style.css deleted file mode 100644 index 6d83b5d..0000000 --- a/css/media_style.css +++ /dev/null @@ -1,2 +0,0 @@ -@page {sheet-size: A4;} -@media print{body{background-color:#FFF;font-style:normal;font-size:7pt;font:Times New Roman;size:portrait;color:#494949;margin:0 1mm}a{color:#3e3fff}#page{width:100%;margin:0}#prntpg{width:42%}.prntpgimg{width:160px}.box{width:100%; border:none;margin:5px 0 0}.box .cont{text-align:justify}.box .cont h2{font-size:11pt;color:#1B4381;font-weight:700;page-break-after:auto}h1,h2{page-break-after:auto}table{border:none;border-collapse:collapse}.tborder table{border-collapse:collapse}.tborder table td,.tborder table th{border:1pt solid #C4C4C4;text-align:left;padding:0 1px}.box .smenu{position:relative;float:left;border:0;width:auto;height:16px;margin:0;padding:0 0 0 10px}.box .smenu ul{border:0;list-style-type:none;margin:0;padding:0}.box .smenu ul li{position:static}.smenu{position:relative;float:left;border:0;height:24px;width:100%;font-size:8pt;font-weight:700;margin:0;padding:0 10px}.smenu a{color:#000}.smenu ul{border:0;list-style-type:none;line-height:24px;margin:0;padding:0}.smenu ul li{position:relative}.smenu ul li a,.smenu ul li a:visited{display:block;text-decoration:none;height:auto}.smenu ul li:hover a,.smenu ul li a:hover{height:auto}.box table{border:none;text-align:left}.box .tbl_hdr{border:1pt solid #cdcecf;background-color:#28326f;color:#eff0ef;padding-left:2px;padding-right:2px}.box .tbl_hdr a{line-height:16pt;text-decoration:underline;font-weight:400;vertical-align:baseline;color:#FFF;padding:0 15px}.box .tbl_hdr a:hover{text-decoration:none}.box table tr .bgr{background-color:none;background-image:url(../img/bg_cont.png);background-repeat:repeat-x}.box .tborder table{border:1pt solid #C4C4C4;border-collapse:collapse}.box .tborder table td,.box .tborder table th{border:1pt solid #C4C4C4}.center_text{text-align:center}#footer{color:#898989;font-size:7pt;text-align:center}.menu,#hdr,.box .smenu ul li ul,.smenu ul li ul,input[type=submit],#print_doc,.prnt,.noprint{display:none}a img,img{border:none}input,select{border:1pt solid #B7B8BF;font-size:7pt}.box table tr td,.box table tr th{text-align:left;border:none;padding-left:2px;padding-right:2px}} \ No newline at end of file diff --git a/css/menu.css b/css/menu.css deleted file mode 100644 index 1f880b8..0000000 --- a/css/menu.css +++ /dev/null @@ -1 +0,0 @@ -#menu{position:relative;float:left;border:0;height:30px;width:100%;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:12px;font-weight:700;z-index:10;margin:151px 0 0;padding:0}#menu table{background-color:inherit;width:933px;border-collapse:collapse;margin-left:18px}#menu table tr{height: 32px;*height:31px;text-align:center}#menu table tr td{border-left:1px solid #7896A5;border-right:1px solid #7896A5;border-collapse:collapse;padding:0 10px}#menu table tr td ul{border:0;list-style-type:none;line-height:31px;margin:0;padding:0}#menu table tr td ul li:hover a,#menu table tr td ul li a:hover{height:auto;color:#ffffe8}#menu table tr td ul li:hover ul,#menu table tr td ul li a:hover ul{display:block;position:absolute;text-align:left;font-size:8pt;font-weight:400;margin-top:0;left:-11px;height:auto;color:#000;border:1px solid #000;line-height:1.5em;background-image:url(../img/smenu_bgr.png)}#menu table tr td ul li ul li,#menu table tr td ul li a ul li{border:0;float:left;height:auto;width:17em;border-bottom:1px solid #A8ACB3;border-right:1px solid #A8ACB3;border-left:1px solid #fff;border-top:1px solid #fff;line-height:1.5em;background-image:url(../img/smenu_bgr.png);margin:0;padding:1px 4px}#menu table tr td ul li ul li:hover,#menu table tr td ul li a ul li:hover{background-image:none;background-color:#27326E} .smenu{position:relative;float:left;border:0;height:28px;font-size:12px;font-weight:700;margin:0;padding:0 13px}.separator{background-image:url(../img/separator.png);background-position:right;background-repeat:no-repeat}.smenu ul{border:0;list-style-type:none;line-height:24px;margin:0;padding:0}.smenu ul li:hover a,.smenu ul li a:hover{height:auto}.smenu ul li:hover ul,.smenu ul li a:hover ul{display:block;position:absolute;text-align:left;font-size:8pt;font-weight:400;margin-top:0px;*margin-top:18px;left:-15px;height:auto;line-height:1.5em}.smenu ul li:hover ul li a,.smenu ul li a:hover ul li a,.smenu ul li .submenu_text{border:0;padding:0;float:left;height:auto;color:#494949;background-image:url(../img/smenu_bgr.png);min-width:13.5em;border:1px solid #A8ACB3;border-right:2px solid #A8ACB3;margin:0;padding:1px 4px}.smenu ul li:hover ul li:hover a,.smenu ul li a:hover ul li a:hover,.smenu ul li .submenu_text:hover{color:#fff;background:#27326E;cursor:pointer}#menu a,#menu table tr td ul li:hover ul li:hover a,#menu table tr td ul li a:hover ul li a:hover{color:#FFF}#menu table tr td ul li,.smenu ul li{position:relative}#menu table tr td ul li ul,.smenu ul li ul{display:none}#menu table tr td ul li a,#menu table tr td ul li a:visited,.smenu ul li a,.smenu ul li a:visited{display:block;text-decoration:none;height:auto}#menu table tr td ul li:hover ul li a,#menu table tr td ul li a:hover ul li a,.smenu a{color:#494949}#menu table tr td a img,#menu table tr td img{border:1px solid #A6B5BB;margin:0 2px} \ No newline at end of file diff --git a/css/stylen.css b/css/stylen.css deleted file mode 100644 index 4f970e2..0000000 --- a/css/stylen.css +++ /dev/null @@ -1,57 +0,0 @@ -html,body{background-color:#CDCECF;text-align:left;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:8pt;font-weight:400;color:#494949;height:100%;background-position:center;margin:auto}#page{padding-bottom:15px;width:980px;background-color:#FFF;border:2px solid #A6B5BB;margin:10px auto}#hdr{width:100%;_width:980px;height:183px;background-color:#28326F;background-image:url(../img/header.jpg);background-repeat:no-repeat;margin:0;padding:0}#ttl{position:absolute;margin-top:25px;margin-left:32px;background:none}#title_chmi{position:absolute;color:#1E2245;font-family:Arial;margin-top:121px;margin-left:67px;font-weight:bolder}.box{border:2px solid #C4C4C4;background-image:url(../img/bg_box.png);background-repeat:repeat-y;background-color:#EFF0EF;margin:15px 15px 0}.box .cont{background-image:url(../img/bg_cont.png);background-repeat:repeat-x;text-align:justify;margin:1.5pt;padding:4px 10px}.box .cont h2{font-size:9pt;font-weight:bolder;min-height:15px;margin:1px 0 16px}.box .cont h2.alert{background-image:url(../img/em.png);background-repeat:no-repeat;padding-left:18px;color:#D20000}.box table{border:none;text-align:left}.box .tbl_hdr{border:1px solid #cdcecf;background-color:#28326f;color:#eff0ef;padding-left:4px;padding-right:3px}.box .tbl_hdr a{line-height:18pt;text-decoration:underline;font-weight:400;vertical-align:baseline;color:#FFF;padding:0 25px}.box .tbl_hdr a:hover{text-decoration:none}.bgr{background-color:none;background-image:url(../img/bg_cont.png);background-repeat:repeat-x}.box .tborder table{border:1px solid #C4C4C4;border-collapse:collapse}.box .tborder table td,.box .tborder table th{border:1px solid #C4C4C4;text-align:left}.center_text{text-align:center}a{color:#3e3fff;text-decoration:none}a:hover{text-decoration:underline}#footer{margin-top:10px;padding-bottom:5px;text-align:center;color:#494949;font-size:7pt}select{border:1px solid #B7B8BF;font-size:8pt}#detail{position:absolute;top:0;left:0;z-index:0;visibility:hidden}#detail #detail_table{background-color:#D5D4D8;background-image:url(../img/mgraph_bg.png);width: 345px;;background-repeat:repeat-y;margin:-3px 0;padding:0 0 0 5px}#detail #detail_table table{border:none;background-color:#FFF;border-collapse:collapse}#detail #detail_table table td{border:none;line-height:15px;padding-left:10px;padding-right:3px;border-top:1px solid #b7b8bf;text-align:left}#detail #detail_table table th{background-color:#CEEEFF;line-height:22px;padding-left:10px;padding-right:10px;border:none;border-bottom:1px solid #b7b8bf;text-align:left}.srazka_map{background-image:url(../img/oro_sl.png);height:528px;width:728px;background-repeat:no-repeat;border:1px solid #C4C4C4}#print_doc{position:relative;float:right;cursor:pointer}#xml_export{position:relative;z-index:0;visibility:hidden}.box table tr td,.box table tr th{text-align:left;border:none;padding-left:4px;padding-right:3px}a img,img{border:none}input,textarea{color:#000;border:1px solid #B7B8BF;font-size:8pt} -#sshow_s,#sshow{position:relative}#sshow_s img,#sshow img{position:absolute;top:0;left:0;z-index:8;opacity:0.0}#sshow_s img.active,#sshow img.active{z-index:10;opacity:1.0}#sshow_s img.last-active,#sshow img.last-active{z-index:9}#i_menu_s .active,#i_menu .active,table.rainm_tbl tr th.act{background:#494949;color:#fff}#i_menu .last-active{background:inherit}table.rainm_tbl{width:100%;margin-bottom:10px}table.rainm_tbl tr th,#i_menu_s p,#i_menu p{border:1px solid #c4c4c4}table.rainm_tbl tr th{width:20px;text-align:center}table.rainm_tbl tr th a,#i_menu_s p,#i_menu p{color:#494949} -#i_menu_s p,#i_menu p{padding:3px 0;margin:1px 0;font-weight:bold}#showpre{width:100%;line-height:528px;vertical-align:middle;text-align:center;}.tsrz table,.tsrz table tr td,.tsrz table tr td.sdt{border:1px solid #c4c4c4}.tsrz table{border-collapse:collapse;width:100%}.tsrz table tr td,.tsrz table tr th{text-align:center}.tsrz table tr th{background:#28326f;border:1px solid #cdcecf}.tsrz table tr th,.tsrz table tr th.infow,.tsrz table tr th.info{color:#eff0ef}.tsrz table tr th.mnt{background:#4252b9;font-size:8px}.tsrz table tr td.mnt,.tsrz table tr th.mnt{width:32px;display:none}.tsrz table td.mnt{background:#f8fce8}.tsrz table tr th.infow,.tsrz table tr th.info{background:#808080}.tsrz table tr th.infow{width:60px}.tsrz table tr td.info{text-align:left;width:180px}.tsrz table tr td.sdt{background:#f4f4cb} -#iashow_s,#iashow{position:relative}#iashow_s img,#iashow img{position:absolute;top:0;left:0;z-index:8;opacity:0.0}#iashow_s img.active,#iashow img.active{z-index:10;opacity:1.0}#iashow_s img.last-active,#iashow img.last-active{z-index:9} -.news_inf{ - /*#C4C4C4*/ - margin:0px 0px; background-color:#fff; border:1px solid #EFF0EF; - width: 425px; - padding:10px; - position: static; -} - -.news_inf h1{ - font-size: 10pt; - margin:5px 0px; -} - -.news_inf h1 a{ - color:#494949; -} - -.news_inf h3{ - font-size: 8pt; - margin:2px 0px; - font-weight: normal; - -} -.fsort{font-weight: BOLD;line-height: 30px;} -.fsort input.srt { vertical-align: middle;margin: 0px 4px; border: none;} -.fsort select.srt { vertical-align: middle;margin: 0px 4px;} -div.odbpokyny{ - margin:25px 0px 0px 0px; -} -div.opphsimg{ - margin:25px 0px; - font-style:italic; - line-height: 20px; - -} -table.opphps_tbl tr td{ - border : 1px solid #C4C4C4; - border-collapse:collapse; -} - -table.opphps_tbl{ - border-collapse:collapse; - margin:auto; -} -table.opphps_tbl tr td.opphps_1{ - background-color: yellow; -} -table.opphps_tbl tr td.opphps_2{ - background-color: orange; -} -table.opphps_tbl tr td.opphps_3{ - background-color: orangered; -} \ No newline at end of file diff --git a/data/.gitignore b/data/.gitignore new file mode 100644 index 0000000..f012809 --- /dev/null +++ b/data/.gitignore @@ -0,0 +1,3 @@ +prutok.png +stav.png +table.html diff --git a/data/doprava.png b/data/doprava.png new file mode 100644 index 0000000..abed44e Binary files /dev/null and b/data/doprava.png differ diff --git a/doprava.haml b/doprava.haml new file mode 100644 index 0000000..f7c56ca --- /dev/null +++ b/doprava.haml @@ -0,0 +1,21 @@ +!!! 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 Povodne - Voda + %body + + %ul#navbar + %li.logo   + %li Voda + %li.active Doprava + + .content + + #imgdoprava + %img(src="data/doprava.png" width="100%") + + #doprava + =File.read("data/doprava.html") diff --git a/img/brmlab.png b/img/brmlab.png new file mode 100644 index 0000000..589e3cc Binary files /dev/null and b/img/brmlab.png differ diff --git a/img/chmi.jpg b/img/chmi.jpg deleted file mode 100644 index a6dea49..0000000 Binary files a/img/chmi.jpg and /dev/null differ diff --git a/img/chmi_logo.jpg b/img/chmi_logo.jpg deleted file mode 100644 index e0d7993..0000000 Binary files a/img/chmi_logo.jpg and /dev/null differ diff --git a/img/hsf.jpg b/img/hsf.jpg deleted file mode 100644 index 6afb66c..0000000 Binary files a/img/hsf.jpg and /dev/null differ diff --git a/img/mailtos.gif b/img/mailtos.gif deleted file mode 100644 index a8b63c0..0000000 Binary files a/img/mailtos.gif and /dev/null differ diff --git a/img/pdf.png b/img/pdf.png deleted file mode 100644 index ec566c7..0000000 Binary files a/img/pdf.png and /dev/null differ diff --git a/img/print.png b/img/print.png deleted file mode 100644 index 2d26f47..0000000 Binary files a/img/print.png and /dev/null differ diff --git a/img/rback.png b/img/rback.png deleted file mode 100644 index ab4066a..0000000 Binary files a/img/rback.png and /dev/null differ diff --git a/index.haml b/index.haml new file mode 100644 index 0000000..244dc26 --- /dev/null +++ b/index.haml @@ -0,0 +1,32 @@ +!!! 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 Povodne - Voda + %body + + %ul#navbar + %li.logo   + %li.active Voda + %li Doprava + + .content + + %table.twocolumn + %tr + %td(style="padding: 16px;") + .imgstav + %img(src="data/stav.png") + .imgprutok + %img(src="data/prutok.png") + %td(style="padding: 16px;") + %table#legend24h(style="margin: 16px;") + =File.read("data/legend.html") + %table#table24h + %tr + %th datum a čas + %th stav [cm] + %th průtok [m3s-1] + =File.read("data/table.html") diff --git a/refre.sh b/refre.sh deleted file mode 100755 index 3122b70..0000000 --- a/refre.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -wget 'http://hydro.chmi.cz/hpps/popup_hpps_prfdyn.php?seq=307225' -O index.html -mkdir -p tmp/img/big -wget 'http://hydro.chmi.cz/hpps/tmp/img/big/307225_H.png' -O tmp/img/big/307225_H.png -wget 'http://hydro.chmi.cz/hpps/tmp/img/big/307225_Q.png' -O tmp/img/big/307225_Q.png diff --git a/style.css b/style.css new file mode 100644 index 0000000..d2e2b0f --- /dev/null +++ b/style.css @@ -0,0 +1,72 @@ +html, body { + font-family:Verdana, Arial, Helvetica, sans-serif; + margin: 0; + padding: 0; +} + +.content { + padding: 1em; + padding-top: 48px; +} + +ul#navbar { + height: 48px; + background: #333; + list-style-type: none; + margin: 0; + padding: 0; + position: fixed; + width: 100%; +} + +ul#navbar li { + display: block; + float: left; + padding-left: 8px; + padding-right: 8px; + height: 48px; + line-height: 48px; +} + +ul#navbar li.logo { + background: url('img/brmlab.png') no-repeat; + margin-left: 8px; + width: 150px; +} + +ul#navbar li a { + color: #888; + text-decoration: none; + font-weight: bold; + font-size: 1.2em; +} + +ul#navbar li.active a, ul#navbar li a:hover { + color: #fff; +} + + +table#table24h { + border-collapse: collapse; + border: 1px solid #c4c4c4; + font-size: 0.8em; +} + +table#legend24h { + font-size: 0.8em; +} + +table#table24h th, table#table24h td { + border: 1px solid #c4c4c4; + padding-left: 4px; + padding-right: 4px; +} + +table#table24h th { + background: #28326f; + color: #eff0ef; +} + +#doprava { + font-size: 0.8em; +}