projects
/
tclrobot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
347b3d0
)
Robot saves metadata with unique names in directory "flat" (if it exists).
author
Adam Dickmeiss
<adam@indexdata.dk>
Wed, 31 Oct 2001 08:51:49 +0000
(08:51 +0000)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Wed, 31 Oct 2001 08:51:49 +0000
(08:51 +0000)
robot.tcl
patch
|
blob
|
history
diff --git
a/robot.tcl
b/robot.tcl
index
4a30d17
..
5210452
100755
(executable)
--- a/
robot.tcl
+++ b/
robot.tcl
@@
-1,5
+1,5
@@
#!/usr/bin/tclsh
#!/usr/bin/tclsh
-# $Id: robot.tcl,v 1.22 2001/10/30 08:29:54 adam Exp $
+# $Id: robot.tcl,v 1.23 2001/10/31 08:51:49 adam Exp $
#
proc RobotFileNext1 {area lead} {
# puts "RobotFileNext1 area=$area lead=$lead"
#
proc RobotFileNext1 {area lead} {
# puts "RobotFileNext1 area=$area lead=$lead"
@@
-597,19
+597,9
@@
proc RobotTextPlain {url out} {
}
}
}
}
-proc Robot200 {url} {
+proc RobotWriteMetadata {url out} {
global URL domains
global URL domains
-
- set out [RobotFileOpen raw $URL($url,hostport) $URL($url,path)]
- puts -nonewline $out $URL($url,buf)
- RobotFileClose $out
-
- if {![checkrule mime $URL($url,head,content-type)]} {
- RobotError $url mimedeny
- return
- }
- set out [RobotFileOpen visited $URL($url,hostport) $URL($url,path)]
puts $out "<zmbot>"
set distance 1000
puts $out "<zmbot>"
set distance 1000
@@
-640,8
+630,29
@@
proc Robot200 {url} {
}
}
puts $out "</zmbot>"
}
}
puts $out "</zmbot>"
+}
+
+proc Robot200 {url} {
+ global URL domains
+
+ set out [RobotFileOpen raw $URL($url,hostport) $URL($url,path)]
+ puts -nonewline $out $URL($url,buf)
RobotFileClose $out
RobotFileClose $out
- # puts "Parsing done"
+
+ if {![checkrule mime $URL($url,head,content-type)]} {
+ RobotError $url mimedeny
+ return
+ }
+ set out [RobotFileOpen visited $URL($url,hostport) $URL($url,path)]
+ RobotWriteMetadata $url $out
+ RobotFileClose $out
+
+ if {[file isdirectory flat]} {
+ regsub -all {/} $URL($url,hostport).$URL($url,path) {.} fname
+ set out [open "flat/$fname" w]
+ RobotWriteMetadata $url $out
+ close $out
+ }
RobotFileUnlink unvisited $URL($url,hostport) $URL($url,path)
}
RobotFileUnlink unvisited $URL($url,hostport) $URL($url,path)
}