egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Download and save a txt File

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
oO3ddYOo
Voice


Joined: 09 Feb 2008
Posts: 2

PostPosted: Sat Feb 09, 2008 3:37 pm    Post subject: Download and save a txt File Reply with quote

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 Smile
Back to top
View user's profile Send private message
Maiki
Voice


Joined: 20 May 2007
Posts: 28

PostPosted: Sat Feb 09, 2008 4:03 pm    Post subject: Reply with quote

Code:
## 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
}
Back to top
View user's profile Send private message
oO3ddYOo
Voice


Joined: 09 Feb 2008
Posts: 2

PostPosted: Sat Feb 09, 2008 4:20 pm    Post subject: Reply with quote

What the [censored] Crying or Very sad

I search many hours and u make it in few minutes Sad

BIG THANX Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber