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.

multiple file saves with lynx

Old posts that have not been replied to for several years.
Locked
N
NewzUK
Master
Posts: 200
Joined: Mon Nov 18, 2002 3:10 am
Location: Auckland, New Zealand
Contact:

multiple file saves with lynx

Post by NewzUK »

Hi

I have a script that, on a timer, retrieves several webpages via lynx and saves them to txt files.

I'm just wondering if there's a more efficiant way to do it, as sometimes it makes the bot ping out...
proc put:getnews { min hour day month year } {
exec lynx -preparsed -dump -width=3000 http://www.url1.com > one.txt

set f [open "one.txt" r]

exec lynx -preparsed -dump -width=3000 http://www.url2.com > two.txt

set f [open "two.txt" r]

exec lynx -preparsed -dump -width=3000 http://www.url3.com > three.txt

set f [open "three.txt" r]

exec lynx -preparsed -dump -width=3000 http://www.url4.com > four.txt

set f [open "four.txt" r]
}
cheers!
#Newsroom - Where News & Markets Connect
http://www.inewsroom.net
#Newsroom on irc.othernet.org
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

1. You can "split" up the time the files are beeing saved.
2. You can use the tcl http-package and make a script
3. Why are you opening the files for reading right after you have saved the html to them, and why don't you close them afterwards?
Elen sila lúmenn' omentielvo
N
NewzUK
Master
Posts: 200
Joined: Mon Nov 18, 2002 3:10 am
Location: Auckland, New Zealand
Contact:

Post by NewzUK »

thanks papillion - will look into this...

:)
#Newsroom - Where News & Markets Connect
http://www.inewsroom.net
#Newsroom on irc.othernet.org
Locked