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.
-
Syntax
- Voice
- Posts: 10
- Joined: Sun Oct 05, 2003 2:37 pm
Post
by Syntax »
someone who can help me make a script thats downloads a website to a file and updates it every 2 min
i would be very gratefull for any help that anyone can give me.
-
Darkj
- Halfop
- Posts: 86
- Joined: Sun Jul 06, 2003 9:58 pm
Post
by Darkj »
Well to download is easy, you can go
catch {exec fetch
http://whatever.com/file.txt}
but from the sounds of things, you meant upload a file every 2 mins with the changes, that I'm not sure of.
-
GodOfSuicide
- Master
- Posts: 463
- Joined: Mon Jun 17, 2002 8:00 pm
- Location: Austria
Post
by GodOfSuicide »
if you choose to exec then do a wget, it's more common i'd say
-
Syntax
- Voice
- Posts: 10
- Joined: Sun Oct 05, 2003 2:37 pm
Post
by Syntax »
Well i kinda solved it
Code: Select all
bind time - "02 00 00 00 2003" test
proc getnews { minute hour day month year } {
exec lynx -dump http://domain/index.html > file.txt
}
now i just got to parse the text
any good ways of doing this?
the timer dossn't quite work and if i try to exec the proc getnews i get that minute dossn't have a value.
anyone who can help me?
running eggdrop v1.6.15
Tcl version: 8.3.3 (header version 8.3.3)
Hope for a quick reply =)
-
Darkj
- Halfop
- Posts: 86
- Joined: Sun Jul 06, 2003 9:58 pm
Post
by Darkj »
To do the update every 2 minutes, your bind time will look like this
bind time - "02 * * * *" test
-
strikelight
- Owner
- Posts: 708
- Joined: Mon Oct 07, 2002 10:39 am
-
Contact:
Post
by strikelight »
Darkj wrote:To do the update every 2 minutes, your bind time will look like this
bind time - "02 * * * *" test
Actually, that would be every 2 minutes past the hour, not every 2 minutes.
-
Darkj
- Halfop
- Posts: 86
- Joined: Sun Jul 06, 2003 9:58 pm
Post
by Darkj »
Oh duh my bad, i guess you'd have to do something like
bind time - "?0 * * * *" test
bind time - "?2 * * * *" test
bind time - "?4 * * * *" test
bind time - "?6 * * * *" test
bind time - "?8 * * * *" test
i think a timer would be better here, but I don't really know those
-
BarkerJr
- Op
- Posts: 104
- Joined: Sun Mar 30, 2003 1:25 am
-
Contact:
Post
by BarkerJr »
Easier would be to bind to time * and do a modulous or set a flag to alternate each time the bind is triggered.
-
Syntax
- Voice
- Posts: 10
- Joined: Sun Oct 05, 2003 2:37 pm
Post
by Syntax »
You are speaking japanese now or something?
i don't understand anything u just wrote..
=)
-
user
-
- Posts: 1452
- Joined: Tue Mar 18, 2003 9:58 pm
- Location: Norway
Post
by user »
Syntax wrote:You are speaking japanese now or something?
Here it is in tcl (the modulous way)
Code: Select all
bind time - * theProc
proc theProc {min args} {
if {[expr {[format %g $min]%2}]} {return}
# insert some code here
}
Have you ever read "The Manual"?