From ace1c922dcf7c3b6280b2c95848490bc3d880def Mon Sep 17 00:00:00 2001 From: erana Date: Wed, 1 Feb 2012 16:38:59 +0900 Subject: [PATCH] spider function --- s48/cavespider/load.scm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/s48/cavespider/load.scm b/s48/cavespider/load.scm index 4692a27..a16d560 100644 --- a/s48/cavespider/load.scm +++ b/s48/cavespider/load.scm @@ -32,15 +32,15 @@ (spider-rec (list hostname) 0)) (define (spider-rec hostname-list index) - (let ((url-list (file-contents->url file-contents 0))) - (let ((dir-filename (ask-server (string-append "GET / HTTP/1.0" (string #\return #\newline #\return #\newline)) "index.html" hostname port))) - (let ((file-contents (file->string (string-append dir-filename "/" "index.html"))) - (hostname-list (append hostname-list (url->hostname url-list '()))) - (keyword-list (file-contents->keyword file-contents keyword))) + (let ((file-contents (file->string (string-append dir-filename "/" "index.html")))) + (let ((url-list (file-contents->url file-contents 0))) + (let ((dir-filename (ask-server (string-append "GET / HTTP/1.0" (string #\return #\newline #\return #\newline)) "index.html" hostname port))) + (let ((hostname-list (append hostname-list (url->hostname url-list '()))) + (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 (cdr hostname-list) (+ index 1)) - )))) + (hash-set! table (string-append keyword (number->string index)) file-contents);;NOTE keys are variable due to append above + (spider-rec (cdr hostname-list) (+ index 1)) + )))))