Code: Select all
# We need http package
#package req http
bind pub - !tv info:tv
proc info:tv {nick host handle chan text} {
set url "http://tvprogram.nu/cgi-tvprogram/pp1.cgi?NU-palmpilot.htm"
set data [http::data [http::geturl $url]]
if {![regexp -nocase {<b>SVT1</b>(.*?)<b>([0-9\.]+) ([0-9a-zA-ZåäöÅÄÖ\-\.\,\?\:\'\&\n ]*)</b>} $data data2 ok time1 tv1]} {set tv1 "?"; set time1 "?"}
if {![regexp -nocase {<b>SVT2</b>(.*?)<b>([0-9\.]+) ([0-9a-zA-ZåäöÅÄÖ\-\.\,\?\:\'\&\n ]*)</b>} $data data2 ok time2 tv2]} {set tv2 "?"; set time2 "?"}
if {![regexp -nocase {<b>TV3 SVERIGE</b>(.*?)<b>([0-9\.]+) ([0-9a-zA-ZåäöÅÄÖ\-\.\,\?\:\'\&\n ]*)</b>} $data data2 ok time3 tv3]} {set tv3 "?"; set time3 "?"}
if {![regexp -nocase {<b>TV4</b>(.*?)<b>([0-9\.]+) ([0-9a-zA-ZåäöÅÄÖ\-\.\,\?\:\'\&\n ]*)</b>} $data data2 ok time4 tv4]} {set tv4 "?"; set time4 "?"}
if {![regexp -nocase {<b>TV4\+</b>(.*?)<b>([0-9\.]+) ([0-9a-zA-ZåäöÅÄÖ\-\.\,\?\:\'\&\n ]*)</b>} $data data2 ok time5 tv5]} {set tv5 "?"; set time5 "?"}
if {![regexp -nocase {<b>KANAL5</b>(.*?)<b>([0-9\.]+) ([0-9a-zA-ZåäöÅÄÖ\-\.\,\?\:\'\&\n ]*)</b>} $data data2 ok time6 tv6]} {set tv6 "?"; set time6 "?"}
if {![regexp -nocase {<b>ZTV</b>(.*?)<b>([0-9\.]+) ([0-9a-zA-ZåäöÅÄÖ\-\.\,\?\:\'\&\n ]*)</b>} $data data2 ok time7 tv7]} {set tv7 "?"; set time7 "?"}
set svt1 [lindex [split $tv1 \n] 0]
set svt2 [lindex [split $tv2 \n] 0]
set tv3 [lindex [split $tv3 \n] 0]
set tv4 [lindex [split $tv4 \n] 0]
set tv42 [lindex [split $tv5 \n] 0]
set kanal5 [lindex [split $tv6 \n] 0]
set ztv [lindex [split $tv7 \n] 0]
puthelp "PRIVMSG $chan :\002SVT1:\002 \[${time1}\] $svt1 \002SVT2:\002 \[${time2}\] $svt2 \002TV3:\002 \[${time3}\] $tv3"
puthelp "PRIVMSG $chan :\002TV4:\002 \[${time4}\] $tv4 \002TV4+:\002 \[${time5}\] $tv42 \002KANAL5:\002 \[${time6}\] $kanal5 \002ZTV:\002 \[${time7}\] $ztv" }
i changed this code: ([0-9a-zA-ZåäöÅÄÖ\-\.\,\?\:\'\&\n ]*)
to: ([0-9a-zA-ZåäöÅÄÖ\-\.\,\?\:\'\&\n\ü ]*)
result: Tcl error [info:tv]: couldn't compile regular expression pattern: invalid escape \ sequence
pls hilfi