depending of your tcl version, it may include an http package either you'll need to get the library.
there is also a library of html. procs name start with ::http:: and ::html::
there a piece of code I used to fill abuse report form at geocities about webpage spreading rol.vbs exploit. usage : geosite url then the bot check for presence of rol.vbs string on the page. if found, fill the report form :
package require http
proc httpCallback {token} {
global geosite_state geosite_url blah
upvar #0 $token state
set blah "$state(http) $geosite_state($token)"
if { [string match "HTTP/1.1 200 OK*" "$state(http)"] } {
switch -exact $geosite_state($token) {
0 {
set geosite_state($token) 2
set query [::http::formatQuery email example_email@yahoo.com text_input20 $geosite_url($token) select30 opt306 textarea40 "is spammed on irc" from_url "" send "Send"]
catch [ ::http::geturl http://add.yahoo.com/fast/help/us/geo/cgi_abuse -command httpCallback -query $query -blocksize 4096]
}
1 {
set geosite_state($token) 2
set query [::http::formatQuery email example_email@yahoo.com text_input20 $geosite_url($token) select30 opt302 textarea40 "contains js.exception exploit" from_url "" send "Send"]
catch [ ::http::geturl http://add.yahoo.com/fast/help/us/geo/cgi_abuse -command httpCallback -query $query -blocksize 4096]
}
2 {
putlog "!checkweb! geosite_url($token) report ok"
unset geosite_state($token) geosite_url($token)
}
default {
unset geosite_state($token) geosite_url($token)
}
} {
putlog "!checkweb! problem reporting geosite_url($token) : $blah"
unset geosite_state($token) geosite_url($token)
}
}
proc httpHandlerCallback {socket token} {
global geosite_state
set data [read $socket 4096]
set nbbytes [string length $data]
if { [string match "*rol.vbs*" $data] } {
set geosite_state($socket) 1
}
return $nbbytes
}
proc geocheck { url } {
global geosite_state geosite_url blah
if { "[string index $url end]" == "/" } { set urll "$url" } { set urll "$url/" }
set sock [::http::geturl "$urll" -command httpCallback -handler httpHandlerCallback -blocksize 4096]
set geosite_state($sock) 0
set geosite_url($sock) $urll
}
note that not all tcl version of the http package will allow you to have the callback and handler specified at same time in ::http::geturl
sorry to have posted so long tcl code here