Code: Select all
package require http
bind pub - !news www:news
proc www:news {nick host handle chan text} {
set token [::http::geturl http://anysite.com -timeout 10000]
set status [::http::status $token]
::http::cleanup $token;
set data [http::data [http::geturl http://anysite.com]]
regexp {<html>(.*?)<html>} $data data something
set news "$something"
set news.old "$news"
set count 3
if {$count=="5"} {return}
if {$news != "news.old"} {
puthelp "PRIVMSG $chan :$news"
incr count
}