package require http
bind pub - !radio pub:radio
proc pub:radio {nick handle host chan text } {
set mydata "$chan"
set token [::http::geturl "http://something.com/" -command [list mycallback "$mydata"]]
}
proc mycallback {mydata token} {
set data [::http::data $token]
foreach z [split $data \n] {
putserv "PRIVMSG $mydata :$z"
}
}
putlog "radio.tcl loaded"
With it he says in the channel the html code of that page. After he finishes sits a bit and the he starts pasting stuff don't know from where he colects them, I've also noticed a warning on party line: !!! OVER MAXIMUM SERVER QUEUE. What to change/add to make it stop doing this? Also, how to read from a web page like this: http://something.com:8000/? I've tryed the it and nothing. I even tryed a closed port and was working, got a error with a notice that port is closed.
Oh, and the junk he pastes on the channel after finishin the html code sound like this:
On that server is running an Apache web server on the 8080 port and an shoutcast radio server on 8000. I'm reading and getting that junk from the apache server, when I try the shoutcast server is not working due an unknows reason..
Once the game is over, the king and the pawn go back in the same box.
After a complete request, the collected deta remains in memory, until you remove it, using the ::http::cleanup command.
THis means lots of wasted memory each time.
However, I suspect both the blocksize option, and cleaningup, will help such issues.
If an existing http request/data download has taken place, the http package, will not reuse the token. Meaning it can't be a clash of data (though the memory issue is still there, without a cleanup).
As for blocksize, this is used to state how much buffering takes place, and how manhy byte are read per filevent. If there is less than X bytes in the buffer when reading, then only read the buffer length. There is no penalty, and no errornous data return up to X bytes.
All issues point towards the URL you are downloading from, sending some sort of music feed, which you did not request. I sugest looking at the URL you are trying to obtain from youself.
Too be perfectly honest, I was going to test it, using a slightly modified version of your own script, but without a real URL like the one yours if failing on, I can't help more.
With no cleanup code, and using exactly the same as you (however, only printing the size of the text, and random portions of it), I had no errornous output, even when processing 7 URL's at the same time.
yes, I've used ::http::cleanup $token.. I'm asking for a way to stop it getting that junk from the server.. the html code is pasted corectly then starts spreading junk in the channel..
Once the game is over, the king and the pawn go back in the same box.
To be honest I haven't understood a damn thing about this *problem*.. I've tryed http://something.com/ to listen with winamp like I do for the radio and is not working, this means that somewhere is a *leek* of info.. Something is weird round here. I'll take a deeper look at the server, the tcl code and thru the forum and search for other alternatives for this radio thing..
Once the game is over, the king and the pawn go back in the same box.