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.
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
oO3ddYOo
Voice
Posts: 2 Joined: Sat Feb 09, 2008 3:28 pm
Post
by oO3ddYOo » Sat Feb 09, 2008 3:37 pm
Hi @ll
I search this Request in all forums but i didnt find anything.
What i will:
I want a Tcl Script to download a txt file from a homepage and save a specified path.
Example:
!download
He download or open the txt file:
http://www.mywebspace.de/maps.txt
and save this file to eggdrop/scripts
If the txt file already exists he have to overwrite/delete the old one.
I hope someone can help.
Sorry for my bad english, i come from Germany *g*
Thanks for all help
Maiki
Voice
Posts: 28 Joined: Sun May 20, 2007 4:58 pm
Post
by Maiki » Sat Feb 09, 2008 4:03 pm
Code: Select all
## Set url
set url "http://www.mywebspace.de/maps.txt"
##################### No edit ######################
if {[catch {package require http} error]} { putlog "Error=$error" }
bind pub - !download download
proc download {nick uhost hand chan arg} {
set tok [http::geturl $::url]
set data [http::data $tok]
http::cleanup $tok
set fs [open scripts/download.txt w]; puts $fs $data; close $fs
}
oO3ddYOo
Voice
Posts: 2 Joined: Sat Feb 09, 2008 3:28 pm
Post
by oO3ddYOo » Sat Feb 09, 2008 4:20 pm
What the [censored]
I search many hours and u make it in few minutes
BIG THANX