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 get

Old posts that have not been replied to for several years.
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

ok figured it out

Code: Select all

source lib/tcl8.4/http2.4/http.tcl 

bind pub m !update update:pub 

proc update:pub {nick uhost hand chan arg} { 
  set out [lindex $arg 0] 
  set url [lindex [split $arg] 1] 
  set fid [open $out w+] 
  fconfigure $fid -translation binary
  set body [http::data [set token [http::geturl $url -binary 1 -timeout 9999]]] 
  puts $fid $body 
  close $fid 
  http::cleanup $token 
  putquick "NOTICE $nick :Download complete." 
}
TnX for the help REALY appriciate it hehe
XplaiN but think of me as stupid
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

Good :)
just to answer your questions... to let others know ;)....
the -timeout option is there to set a certain time the connection should try to get a successfull reply, if it doesn't get it by the given time you will get an error.

Code: Select all

set out [lindex $arg 0] 
this is still wrong...
lindex is a list command and shall ONLY be used on valid lists. $arg is not a valid list so you will have to make it one before using lindex on it
Elen sila lúmenn' omentielvo
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

You don't have to set a filname each time... Just use the file command on the url and name the file to the same as the one beeing downloaded
Elen sila lúmenn' omentielvo
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

TnX for answering ok , one more question what would be a good way to set the first char then ?

and what is lindex used for .... or when hehe

so i probably should do this
set arg [split $arg]
set out [lindex $arg 0]
set url [join [lrange $arg 1 end]]
or am i wrong again :/ lol

so what is the difference between lrange lindex lsearch i think is there as well so i mean when do i use one or an other to me they all look the same just named different

i only understand i can do this instead of using set

lindex {a, b}

and use them as vars .. instead of using set
XplaiN but think of me as stupid
Locked