(define-structure plugin plugin-interface (open scsh scheme plugin-utilities httpd-responses crlf-io) (begin (define *data* '()) (define (read-data) (let ((news-input (open-input-file "news.txt"))) (let loop ((next-line (read-crlf-line news-input))) (if (eof-object? next-line) (close news-input) (begin (set! *data* (cons next-line *data*)) (loop (read-crlf-line news-input))))))) (define (main req) (if (null? *data*) (read-data)) (let loop ((count (- (length *data*) 1))) (if (< count 0) (send/finish (make-response http-status/ok (status-code->text http-status/ok) (time) "text/html" '() (make-writer-body (lambda (out options) (format out "

THAT'S IT

That's it..."))))) (begin (send/suspend (lambda (next-url) (make-response http-status/ok (status-code->text http-status/ok) (time) "text/html" '() (make-writer-body (lambda (out options) (format out "

~a

read more..." (list-ref *data* count) next-url)))))) (loop (- count 1)))))) ))