[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Search]

Searching the RFB&D catalog with emacspeak-websearch



In the current version of Emacspeak, you can't use the Web search
command to search through the catalog of Recording for the Blind and
Dyslexic.  Here is a patch that you can apply in the
emacspeak-websearch.el file in the source distribution to make it
work:

--- emacspeak-12.0/lisp/emacspeak-websearch.el.orig	Sun Apr 30 17:52:15 2000
+++ emacspeak-12.0/lisp/emacspeak-websearch.el	Sat May 13 15:50:39 2000
@@ -1124,7 +1124,7 @@
 (emacspeak-websearch-set-key ?R 'rfb)
 
 (defvar emacspeak-websearch-rfb-uri
-"http://www.rfbd.org/catalog/search_results.asp?"
+"http://www.rfbd.org/catalog/search_process.asp"
 "URI for searching RFB catalogues.")
 
 (defun emacspeak-websearch-rfb-search (author title)
@@ -1135,12 +1135,11 @@
     (emacspeak-websearch-read-query "Title:")))
   (declare (special emacspeak-websearch-rfb-uri))
   (let ((url-be-asynchronous nil))
-    (browse-url 
-     (concat emacspeak-websearch-rfb-uri
-"author="
-             (webjump-url-encode author)
-             "&title="
-             (webjump-url-encode title))))
+    (emacspeak-websearch-query "POST" emacspeak-websearch-rfb-uri
+			       (concat "author="
+				       (webjump-url-encode author)
+				       "&title="
+				       (webjump-url-encode title))))
   (emacspeak-websearch-post-process
    "Number"
   'emacspeak-speak-line))
@@ -1379,6 +1378,34 @@
 ))
     (search-forward group)
     (w3-table-speak-this-cell)))
+
+(defun emacspeak-websearch-query (themeth theurl query &optional enctype)
+  ;; Adapted from w3-submit-form
+  (let* ((enctype (or enctype "application/x-www-form-urlencoded")))
+    (if (and (string= "GET" themeth)
+	     (string-match "\\([^\\?]*\\)\\?" theurl))
+	(setq theurl (url-match theurl 1)))
+    (cond
+     ((or (string= "POST" themeth)
+	  (string= "PUT" themeth))
+      (if (consp query)
+	  (setq enctype (concat enctype "; boundary="
+				(substring (car query) 2 nil)
+				"")
+		query (cdr query)))
+      (let ((url-request-method themeth)
+	    (url-request-data query)
+	    (url-request-extra-headers
+	     (cons (cons "Content-type" enctype) url-request-extra-headers)))
+	(w3-fetch theurl)))
+     ((string= "GET" themeth)
+      (let ((theurl (concat theurl (if (string-match "gopher" enctype)
+				       "" "?") query)))
+	(w3-fetch theurl)))
+     (t
+      (w3-warn 'html (format "Unknown submit method: %s" themeth))
+      (let ((theurl (concat theurl "?" query)))
+	(w3-fetch theurl))))))
 
 ;;}}}
 (provide 'emacspeak-websearch)

-----------------------------------------------------------------------------
To unsubscribe from the emacspeak list or change your address on the
emacspeak list send mail to "emacspeak-request@xxxxxxxxxxx" with a
subject of "unsubscribe" or "help"


Emacspeak Files | Subscribe | Unsubscribe