+ (let ()
+ (define pageno (if (exists-binding? 'pageno binds)
+ (extract-binding/single 'pageno binds)
+ "1"))
+ (define results
+ (foldr cons '()
+ (filter hash?
+ (map (lambda (i)
+ (define result-host
+ (url-host (string->url
+ (hash-ref i 'url ""))))
+ (define result-url (hash-ref i 'url ""))
+ (define result-title (hash-ref i 'title ""))
+ (define result-content (hash-ref i 'content ""))
+ (define ht (make-hash))
+ (unless (member-match? result-host blacklist)
+ (let ()
+ (hash-set! ht "title" result-title)
+ (hash-set! ht "url" result-url)
+ (hash-set! ht "content" result-content)
+ )
+ ht
+ ))
+ (hash-ref (search query pageno) 'results)))))
+ (http-response (string-append
+ (do-head (string-append query " | Web Search"))
+ (include-template "templates/search.html")
+ (do-footer))))
+ (redirect-to "/")))