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.

script ftp

Old posts that have not been replied to for several years.
J
Jailmann
Voice
Posts: 33
Joined: Fri Apr 09, 2004 2:50 pm

script ftp

Post by Jailmann »

Hello

i have a eggdrop bot runnig but i am looking for a script

first sorry for my english not so good to explain

I have a bot that send file to ppl when the ask like this !get filename.zip

but i really want a script that can look at a homepgae if there a newer file with newer date that one there are in the bot

the filename isent always the same name but i should look a folder on the homepage an then look if there are a new date file then if there are then download it :)

i dont no if this is easy or hard to do or if there other way to do it :)

i hope anyone could help me
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

Code: Select all

exec wget -N http://your.homepage/filename.zip
this will retrieve filename.zip from your homepage only if newer than the original
J
Jailmann
Voice
Posts: 33
Joined: Fri Apr 09, 2004 2:50 pm

Post by Jailmann »

Hello

the problem is the file on the homepage dosent have the same name it is a difffrent one ..
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

then keep it locally with same name as on the website, and copy under different name if/when necessary
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

is it from a remote site .. or .. and is there a sequence to the filename changes, or ..

do you got db access .. u need to give more info what resources you got .. cause other wize we all can suggest a crap load of [censored] but half of it won't work..
XplaiN but think of me as stupid
J
Jailmann
Voice
Posts: 33
Joined: Fri Apr 09, 2004 2:50 pm

Post by Jailmann »

Hello

i have shell access on the server (No root access)

The bot is runnig on a linux server with most package install

the bot has a folder that contain files user can get

a file called MX-II.zip is wanted an use get it but i am not so fast to update then i found a page where it is update very fast

i really like the bot to link to the page to look if there are a new file

the file on the page can be called this

MX-II 011204.zip
MX-II 071204.zip

then the link script should look if there are a newer file on that page end that it has on the bot files folder

The bot is on another server end the www. page it should look at
i hope this help a bit more
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Did you mean "http" when you said "ftp" or did I miss something? Do you have access to the new files by any other means than via http?
Have you ever read "The Manual"?
J
Jailmann
Voice
Posts: 33
Joined: Fri Apr 09, 2004 2:50 pm

Post by Jailmann »

Hello

i mean http
J
Jailmann
Voice
Posts: 33
Joined: Fri Apr 09, 2004 2:50 pm

Post by Jailmann »

Hello

this seems to be hard to make

anyone can help with this then same ting just the file have same name on this link

when i writ !update then the tcl script download the file from a http page an put in a folder
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

Code: Select all

bind pub n !update {exec wget -N http://your.homepage/filename.zip;#}
if you think adding this ONE line to your config/scripts is hard, I can't help you further
J
Jailmann
Voice
Posts: 33
Joined: Fri Apr 09, 2004 2:50 pm

Post by Jailmann »

Hello

sorry demond that i ment was the whole other thing was hard to do therefore i found another salution :):)
J
Jailmann
Voice
Posts: 33
Joined: Fri Apr 09, 2004 2:50 pm

Post by Jailmann »

Hello

i was to fast to reply to you hehe

on the bot the scripts ind here bot/scripts an the files are her bot/files

how do i get the file to end up the right place
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Jailmann wrote:how do i get the file to end up the right place
man wget
Jailmann wrote:ment was the whole other thing was hard to do therefore i found another salution :):)
I think "boring" is the word you're looking for. The hard part is getting you to provide enough details...

You failed to tell us what the list looks like (the html)

This is what you need to do:
* download page
* extract url of the last file matching some pattern
* check if it matches the previous filename (which is "" the first time)
* if not: download file and rename it (store the original name to match the next time)

Here's some code to extract the last href matching a pattern...

Code: Select all

set html {
	...
	<A href="../bleh/MX-II 011204.zip">...</A> 
	<A href="../blah/MX-II 071204.zip">...</A>
	...
}
set name {MX-II [0-9]+\.zip}
set href [lindex [regexp -nocase -inline ".*href="(.*?$name)" $html] 1]
Have you ever read "The Manual"?
J
Jailmann
Voice
Posts: 33
Joined: Fri Apr 09, 2004 2:50 pm

Post by Jailmann »

demond wrote:

Code: Select all

bind pub n !update {exec wget -N http://your.homepage/filename.zip;#}
if you think adding this ONE line to your config/scripts is hard, I can't help you further
but the file gois into /bot/ i should go into this /bot/files/
User avatar
CrazyCat
Revered One
Posts: 1293
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

man wget
Locked