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.

Download and save a txt File

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
o
oO3ddYOo
Voice
Posts: 2
Joined: Sat Feb 09, 2008 3:28 pm

Download and save a txt File

Post by oO3ddYOo »

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 :)
M
Maiki
Voice
Posts: 28
Joined: Sun May 20, 2007 4:58 pm

Post by Maiki »

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
}
o
oO3ddYOo
Voice
Posts: 2
Joined: Sat Feb 09, 2008 3:28 pm

Post by oO3ddYOo »

What the [censored] :cry:

I search many hours and u make it in few minutes :(

BIG THANX :D
Post Reply