Code: Select all
package require http
bind msg - !test test_check
proc test_check {nick host hand chan text} {
set url "http://www.sensiblesoccer.de/index.php?lng=en"
set counter 0
set limit "4"
catch { set connection [http::geturl $url -timeout 3000] } error
if {[string match -nocase "*::http::*" $error]} {
set source [http::data $connection];http::cleanup $connection
set source [string map -nocase {"</item>" "|"} $source]
foreach line [split $source |] {
if {[regexp {^.*?<td class="medium"><b class="marker">(.*?)</tr>.*?$} $line tmp lines ]} {
regexp {^.*?<td class="medium"><b class="marker">(.*?)</font></td>.*?$} $lines tmp titel
regexp {^.*<td class="right_rank_header" style="color:silver" bgcolor="#000022">(.*?)*?} $lines tmp link
putserv "PRIVMSG $nick :$titel"
putserv "PRIVMSG $nick :works!:D"
incr counter
}
if {$counter == $limit} {unset counter;return 0}
}
}
}
putlog "news loaded!"Code: Select all
<td class="medium"><b class="marker">New Interview with Jon Hare</font></td>
</tr>
<tr height="16">
<td class="right_rank_header" style="color:silver" bgcolor="#000022">.. by autor on 02.12.2005</td>
</tr>