Mercurial > hg > egg-tcls
comparison fetch_food.tcl @ 424:825cac46b1cb
Cosmetic / stray trailing whitespace cleanup.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 08 Jan 2017 03:55:55 +0200 |
parents | 599b90e41c03 |
children |
comparison
equal
deleted
inserted
replaced
423:44c9128097cd | 424:825cac46b1cb |
---|---|
53 return 1 | 53 return 1 |
54 } | 54 } |
55 | 55 |
56 set upage [::http::data $utoken] | 56 set upage [::http::data $utoken] |
57 ::http::cleanup $utoken | 57 ::http::cleanup $utoken |
58 | 58 |
59 set nmatches 1 | 59 set nmatches 1 |
60 while {$nmatches > 0} { | 60 while {$nmatches > 0} { |
61 set umatches [regexp -nocase -inline -- "<strong>(Maanantai|Tiistai|Keskiviikko|Torstai|Perjantai|Lauantai|Sunnuntai)</strong></td>.?.?<td colspan=\"2\"><strong>(\[^<\]+)</strong></td>(.*)\$" $upage] | 61 set umatches [regexp -nocase -inline -- "<strong>(Maanantai|Tiistai|Keskiviikko|Torstai|Perjantai|Lauantai|Sunnuntai)</strong></td>.?.?<td colspan=\"2\"><strong>(\[^<\]+)</strong></td>(.*)\$" $upage] |
62 set nmatches [llength $umatches] | 62 set nmatches [llength $umatches] |
63 if {$nmatches > 3} { | 63 if {$nmatches > 3} { |
72 } | 72 } |
73 add_entry $dataname [lindex $umatches 1] [lindex $umatches 2] [join $tmp "; "] | 73 add_entry $dataname [lindex $umatches 1] [lindex $umatches 2] [join $tmp "; "] |
74 } | 74 } |
75 set upage [lindex $umatches 3] | 75 set upage [lindex $umatches 3] |
76 } | 76 } |
77 | 77 |
78 return 0 | 78 return 0 |
79 } | 79 } |
80 | 80 |
81 proc add_uniresta {datauri dataname} { | 81 proc add_uniresta {datauri dataname} { |
82 if {[catch {set utoken [::http::geturl $datauri -binary true -timeout 5000]} uerrmsg]} { | 82 if {[catch {set utoken [::http::geturl $datauri -binary true -timeout 5000]} uerrmsg]} { |
105 } | 105 } |
106 add_entry $dataname [lindex $umatches 1] [lindex $umatches 2] [join $tmp "; "] | 106 add_entry $dataname [lindex $umatches 1] [lindex $umatches 2] [join $tmp "; "] |
107 } | 107 } |
108 set upage [lindex $umatches 3] | 108 set upage [lindex $umatches 3] |
109 } | 109 } |
110 | 110 |
111 return 0 | 111 return 0 |
112 } | 112 } |
113 | 113 |
114 | 114 |
115 ########################################################################## | 115 ########################################################################## |