From 9e9ac82ba07255191174493e337cb7377ef02a75 Mon Sep 17 00:00:00 2001 From: erana Date: Wed, 1 Feb 2012 19:00:06 +0900 Subject: [PATCH] spider function --- s48/cavespider/load.scm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/s48/cavespider/load.scm b/s48/cavespider/load.scm index 8eee273..83d441c 100644 --- a/s48/cavespider/load.scm +++ b/s48/cavespider/load.scm @@ -28,10 +28,10 @@ (load "client.scm") -(define (spider-f) - (spider-rec "" (list hostname) 0)) +(define (spider-f html-dir) + (spider-rec "" (list hostname) html-dir 0)) -(define (spider-rec dir-file-name hostname-list index) +(define (spider-rec dir-file-name hostname-list html-dir index) (cond ((or (null? hostname-list) (string=? (car hostname-list) "")) (newline)("spidering ended.")(newline)) @@ -43,13 +43,16 @@ (keyword-list (file-contents->keyword file-contents keyword))) (hash-set! table (string-append keyword (number->string index)) file-contents);;NOTE keys are variable due to append above - (spider-rec dir-file-name-after (cdr hostname-list) (+ index 1)) + (spider-rec dir-file-name-after (cdr hostname-list) html-dir (+ index 1)) ))))))) (display "give hostname name : ") (define hostname (symbol->string (read))) (newline) +(display "give directory on host (type none for 'GET /' fetch) : ") +(define html-dir (symbol->string (read))) +(newline) (display "server name = ")(display hostname) (newline) (display "give port : ") @@ -62,5 +65,5 @@ (define table (make-hash-table HASHTABLESIZE)) -(spider-f) +(spider-f html-dir)