]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/spider/spider-docs.factor
factor: trim using lists
[factor.git] / extra / spider / spider-docs.factor
index 458c1d14d8c0af03d621b1b097b54de6a1eb9d43..4e0aef80896bcd5a58062effde695f499ccf82b5 100644 (file)
@@ -1,7 +1,6 @@
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: help.markup help.syntax io.streams.string urls
-multiline ;
+USING: help.markup help.syntax ;
 IN: spider
 
 HELP: <spider>
@@ -12,51 +11,39 @@ HELP: <spider>
 
 HELP: run-spider
 { $values
-     { "spider" spider }
      { "spider" spider } }
 { $description "Runs a spider until completion. See the " { $subsection "spider-tutorial" } " for a complete description of the tuple slots that affect how thet spider works." } ;
 
-HELP: spider
-{ $description "" } ;
-
-HELP: spider-result
-{ $description "" } ;
-
-HELP: slurp-heap-when
-{ $values
-     { "heap" "a heap" } { "quot1" quotation } { "quot2" quotation } }
-{ $description "Removes values from a heap that match the predicate quotation " { $snippet "quot1" } " and processes them with " { $snippet "quot2" } " until the predicate quotation no longer matches." } ;
-
 ARTICLE: "spider-tutorial" "Spider tutorial"
 "To create a new spider, call the " { $link <spider> } " word with a link to the site you wish to spider."
-{ $code <" "http://concatentative.org" <spider> "> }
+{ $code "\"http://concatenative.org\" <spider>" }
 "The max-depth is initialized to 0, which retrieves just the initial page. Let's initialize it to something more fun:"
-{ $code <" 1 >>max-depth "> }
+{ $code "1 >>max-depth" }
 "Now the spider will retrieve the first page and all the pages it links to in the same domain." $nl
 "But suppose the front page contains thousands of links. To avoid grabbing them all, we can set " { $slot "max-count" } " to a reasonable limit."
-{ $code <" 10 >>max-count "> }
+{ $code "10 >>max-count" }
 "A timeout might keep the spider from hitting the server too hard:"
-{ $code <" USE: calendar 1.5 seconds >>sleep "> }
+{ $code "USE: calendar 1.5 seconds >>sleep" }
 "Since we happen to know that not all pages of a wiki are suitable for spidering, we will spider only the wiki view pages, not the edit or revisions pages. To do this, we add a filter through which new links are tested; links that pass the filter are added to the todo queue, while links that do not are discarded. You can add several filters to the filter array, but we'll just add a single one for now."
-{ $code <" { [ path>> "/wiki/view" head? ] } >>filters "> }
+{ $code "{ [ path>> \"/wiki/view\" head? ] } >>filters" }
 "Finally, to start the spider, call the " { $link run-spider } " word."
 { $code "run-spider" }
 "The full code from the tutorial."
-{ $code <" USING: spider calendar sequences accessors ;
+{ $code "USING: spider calendar sequences accessors ;
 : spider-concatenative ( -- spider )
-    "http://concatenative.org" <spider>
+    \"http://concatenative.org\" <spider>
     1 >>max-depth
     10 >>max-count
     1.5 seconds >>sleep 
-    { [ path>> "/wiki/view" head? ] } >>filters
-    run-spider ;"> } ;
+    { [ path>> \"/wiki/view\" head? ] } >>filters
+    run-spider ;" } ;
 
 ARTICLE: "spider" "Spider"
 "The " { $vocab-link "spider" } " vocabulary implements a simple web spider for retrieving sets of webpages."
-{ $subsection "spider-tutorial" }
+{ $subsections "spider-tutorial" }
 "Creating a new spider:"
-{ $subsection <spider> }
+{ $subsections <spider> }
 "Running the spider:"
-{ $subsection run-spider } ;
+{ $subsections run-spider } ;
 
 ABOUT: "spider"