proc battle:flistenersdata { } {
global shoutcast shoutport shoutpass url_ xml_ fd_ state_
set url_ "/radiosite/modules.php?name=Nuke-Cast"
set xml_ ""
# Setting up timeout length
after 3000 set state_ timeout
set fd_ [socket -async CENSORED CENSORED]
fconfigure $fd_ -buffering line -buffersize 1024
fileevent $fd_ writable {
puts $fd_ "GET $url_ HTTP/1.0\nUser-Agent: CENSORED (Mozilla Compatible)\n"
while { ![eof $fd_] } {
gets $fd_ line
append xml_ $line
}
set state_ connected
}
vwait state_
close $fd_
after cancel set state_ timeout
return $xml_
}
However, I can only access this: /radiosite/modules.php. The ? in the url breaks the http grab. Do you have any ideas on fixing this? I have already tried a \.
The http package is part of the newer versions of tcl, so you should already have it, and its manpage http.html. There's tons of example scripts in the archives and in the forums about how to use the http package, I've written a lot of scripts using it so look around.