Im trying to parse the content of a webpage but it doesnt work (it does tho with some webpages but not with www.google.com).
Heres the code i use:
It displays the right url, "hello" and then nothing. I know body is a big variable but it should display the first line (which it does for some websites, but not with google). Of course i loaded egghelp.tcl in my *.conf and it loads alright.proc parse_proc { nick uhost handle arg } {
global mychan sock
set d [date:offset [clock seconds] %m%d%y]
set url "http://www.google.com"
set target $nick
set sock [egghttp:geturl $url [list parseinfo $target $url] -timeout 600]
puthelp "PRIVMSG $target :$url"
}
proc parseinfo {target url sock} {
set headers [egghttp:headers $sock]
set body [egghttp:data $sock]
puthelp "PRIVMSG $target :hello"
puthelp "PRIVMSG $target :$headers"
puthelp "PRIVMSG $target :$body"
}
What did i do wrong? i do believe the error stands in the way i call egghttp:geturl but i dont know how to fix it