projects
/
tclrobot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
42de48a
)
Fixed bug regarding relative URLs.
author
Adam Dickmeiss
<adam@indexdata.dk>
Thu, 8 Nov 2001 13:49:06 +0000
(13:49 +0000)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Thu, 8 Nov 2001 13:49:06 +0000
(13:49 +0000)
robot.tcl
patch
|
blob
|
history
diff --git
a/robot.tcl
b/robot.tcl
index
2e175d6
..
f6d7900
100755
(executable)
--- a/
robot.tcl
+++ b/
robot.tcl
@@
-1,5
+1,5
@@
#!/usr/bin/tclsh
#!/usr/bin/tclsh
-# $Id: robot.tcl,v 1.25 2001/11/07 11:50:07 adam Exp $
+# $Id: robot.tcl,v 1.26 2001/11/08 13:49:06 adam Exp $
#
proc RobotFileNext1 {area lead} {
# puts "RobotFileNext1 area=$area lead=$lead"
#
proc RobotFileNext1 {area lead} {
# puts "RobotFileNext1 area=$area lead=$lead"
@@
-324,7
+324,7
@@
proc RobotHref {url hrefx hostx pathx} {
foreach c $surllist {
switch -- $c {
.. {
foreach c $surllist {
switch -- $c {
.. {
- if {$pathl > 0} {
+ if {$pathl > 1} {
incr pathl -2
set path [lrange $path 0 $pathl]
incr pathl
incr pathl -2
set path [lrange $path 0 $pathl]
incr pathl
@@
-339,10
+339,12
@@
proc RobotHref {url hrefx hostx pathx} {
}
}
}
}
}
}
- if {$pathl} {
- set path [join $path /]
- } else {
- set path ""
+ if {$debuglevel > 4} {
+ puts "pathl=$pathl output path=$path"
+ }
+ set path [join $path /]
+ if {![string length $path]} {
+ set path /
}
regsub -all {~} $path {%7E} path
set href "$method://$host$path"
}
regsub -all {~} $path {%7E} path
set href "$method://$host$path"
@@
-839,19
+841,10
@@
set robotSeq 0
set workdir [pwd]
set idletime 60000
set acceptLanguage {}
set workdir [pwd]
set idletime 60000
set acceptLanguage {}
+set debuglevel 0
-set i 0
-set l [llength $argv]
-
-if {$l < 2} {
- puts {tclrobot: usage:}
- puts {tclrobot [-j jobs] [-i idle] [-c count] [-d domain] [-r rules] [url ..]}
- puts " Example: -c 3 -d '*.dk' http://www.indexdata.dk/"
- exit 1
-}
# Rules: allow, deny, url
# Rules: allow, deny, url
-set debuglevel 0
proc checkrule {type this} {
global alrules
proc checkrule {type this} {
global alrules
@@
-939,6
+932,16
@@
proc debug {level} {
# Parse options
# Parse options
+set i 0
+set l [llength $argv]
+
+if {$l < 2} {
+ puts {tclrobot: usage:}
+ puts {tclrobot [-j jobs] [-i idle] [-c count] [-d domain] [-r rules] [url ..]}
+ puts " Example: -c 3 -d '*.dk' http://www.indexdata.dk/"
+
+ exit 1
+}
while {$i < $l} {
set arg [lindex $argv $i]
switch -glob -- $arg {
while {$i < $l} {
set arg [lindex $argv $i]
switch -glob -- $arg {
@@
-1010,6
+1013,7
@@
puts "max jobs=$robotsMax"
RobotStart
RobotStart
+
while {$robotsRunning} {
vwait robotsRunning
}
while {$robotsRunning} {
vwait robotsRunning
}