This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

http.tcl help/howto

Old posts that have not been replied to for several years.
Locked
Z
Zygomaticum

http.tcl help/howto

Post by Zygomaticum »

Hi all.

I'm working on a imdb script (another one?, yes, another one, need a special one :)), but i need to work with http.tcl package for it. I got a other imdb script what i'm using as a kinda 'source' for my script. The only problem is i don't realy get (good enough) how the http.tcl works. I checked the tcl dir in linux on my shell and found the package, but no documentation in that dir nor an url in the .tcl file for help or anything.
So has any1 a url or how-to or doc. for the http.tcl package so i can learn what it does and how it works??

Thx, zygomaticum.
I
Iridium

Post by Iridium »

documentation

Your quick howto:

You can either have a callback, (it gets the page then calls another procedure) or, you can use it just to get it there and then.. (but this is dangerous as it can cause the eggdrop to freeze if it is unavaliable)

Code: Select all

set token [::http::geturl "http://www.egghelp.com]
set data [::http::data $token]
$data now contains the egghelp.com 'index'.

alternatively..

Code: Select all

set mydata "$nick"
set token [::http::geturl "http://www.egghelp.com" -command [list mycallback "$mydata"]]

<snip>

proc mycallback {mydata token} {
  set data [::http::data $token]
  putserv "PRIVMSG $mydata :Hellow there! Prepare to be drowned in egghelp.com!"
  foreach z [split $data \n] {
    putserv "PRIVMSG $mydata :$z"
  }
}
Z
Zygomaticum

Post by Zygomaticum »

thx for the help, but after i wrote the post i found a short command-reference and i'm now about as far as you just said, before i read id :)
but thx anyway

greejtz, zygo.
Locked