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.
Old posts that have not been replied to for several years.
NewzUK
Master
Posts: 200 Joined: Mon Nov 18, 2002 3:10 am
Location: Auckland, New Zealand
Contact:
Post
by NewzUK » Fri Jun 20, 2003 7:23 am
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!
Papillon
Owner
Posts: 724 Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no
Post
by Papillon » Fri Jun 20, 2003 8:33 am
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
NewzUK
Master
Posts: 200 Joined: Mon Nov 18, 2002 3:10 am
Location: Auckland, New Zealand
Contact:
Post
by NewzUK » Fri Jun 20, 2003 8:40 am
thanks papillion - will look into this...