set url "http://www.blah..."
set thechan "#mychannel"
if {![info exists egghttp(version)]} {
putlog "egghttp.tcl was NOT successfully loaded."
putlog "egghttp_example.tcl has not been loaded as a result."
} else {
proc your_callbackproc {sock} {
global url
set headers [egghttp:headers $sock]
set body [egghttp:data $sock]
regsub -all "\n" $body "" body
regsub -all -nocase {<br>} $body "<br>\n" body
regexp {a <b>(.*)</b> b} $body - served
# putserv "PRIVMSG $thechan : $served"
putlog "Website '$url' has served $served people so far."
}
bind pub - "!digg" digg
proc digg {nick uhost hand chan arg} {
global url
set sock [egghttp:geturl $url your_callbackproc]
return 1
}
putlog "egghttp_example.tcl has been successfully loaded."
}
The putserv "PRIVMSG $thechan : $served" doesn't work, but putlog does. what im doing wrong here ?
set url "http://www.inflow.freesitedirect.com/randquote.php"
set thechan "#inflow"
bind pub - !digg digg
proc digg {nick uhost hand chan arg} {
global url
set sock [egghttp:geturl $url your_callbackproc]
return 1
}
proc your_callbackproc {sock} {
global url
set headers [egghttp:headers $sock]
set body [egghttp:data $sock]
regsub -all "\n" $body "" body
regsub -all -nocase {<br>} $body "<br>\n" body
regexp {cc is <b>(.*)</b> end} $body - served
putlog "$served"
}
putlog "egghttp_example.tcl has been successfully loaded."
ROFLMAO this is so screwed, even putting the variable $thechan in putlog screws up everything.