1 ;;; search-bbdb.el --- search the Big Brother Data Base for a supplied name
2 ;; Copyright (C) 2014 Free Software Foundation, Inc.
6 (with-slots (process headers) request
7 (let ((name (cdr (assoc "name" headers))))
9 (ws-error process "Must specify a name to search."))
11 (unless (set-buffer (get-buffer "*BBDB*"))
12 (ws-error process "no *BBDB* buffer found"))
13 (bbdb-search-name name)
14 (if (equal (point-min) (point-max))
16 (ws-response-header process 404
17 '("Content-type" . "text/plain"))
18 (process-send-string process
20 (ws-response-header process 200
21 '("Content-type" . "text/plain"))
22 (process-send-string process (buffer-string)))))))