;;; nnweb.el --- retrieving articles via web search engines
-;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
;; Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;;; Code:
(eval-when-compile (require 'cl))
-(eval-when-compile (require 'gnus-clfns))
(require 'nnoo)
(require 'message)
(defvar nnweb-type-definition
'((google
(article . ignore)
- (id . "http://groups.google.com/groups?selm=%s&output=gplain")
+ (id . "http://groups.google.de/groups?selm=%s&output=gplain")
(reference . identity)
(map . nnweb-google-create-mapping)
(search . nnweb-google-search)
- (address . "http://groups.google.com/groups")
+ (address . "http://groups.google.de/groups")
+ (base . "http://groups.google.de")
(identifier . nnweb-google-identity))
(dejanews ;; alias of google
(article . ignore)
(map . nnweb-google-create-mapping)
(search . nnweb-google-search)
(address . "http://groups.google.com/groups")
+ (base . "http://groups.google.com")
(identifier . nnweb-google-identity))
(gmane
(article . nnweb-gmane-wash-article)
"a href=/groups\\(\\?[^ \">]*selm=\\([^ &\">]+\\)\\)" nil t)
(setq mid (match-string 2)
url (format
- "http://groups.google.com/groups?selm=%s&output=gplain" mid))
+ (nnweb-definition 'id) mid))
(narrow-to-region (search-forward ">" nil t)
(search-forward "</a>" nil t))
(mm-url-remove-markup)
(setq Subject (buffer-string))
(goto-char (point-max))
(widen)
- (forward-line 1)
+ (forward-line 2)
(when (looking-at "<br><font[^>]+>")
(goto-char (match-end 0)))
(if (not (looking-at "<a[^>]+>"))
(>= i nnweb-max-hits))
(setq more nil)
;; Yup, there are more articles
- (setq more (concat "http://groups.google.com" (match-string 1)))
+ (setq more (concat (nnweb-definition 'base) (match-string 1)))
(when more
(erase-buffer)
(mm-url-insert more))))
"?"
(mm-url-encode-www-form-urlencoded
`(("q" . ,search)
- ("num". "100")
+ ("num" . "100")
("hq" . "")
- ("hl" . "")
+ ("hl" . "en")
("lr" . "")
("safe" . "off")
("sites" . "groups")))))
(defun nnweb-gmane-wash-article ()
(let ((case-fold-search t))
(goto-char (point-min))
- (re-search-forward "<!--X-Head-of-Message-->" nil t)
+ (search-forward "<!--X-Head-of-Message-->" nil t)
(delete-region (point-min) (point))
(goto-char (point-min))
(while (looking-at "^<li><em>\\([^ ]+\\)</em>.*</li>")
(nth 1 parse)
" "))
(insert ">\n")
- (mapcar 'nnweb-insert-html (nth 2 parse))
+ (mapc 'nnweb-insert-html (nth 2 parse))
(insert "</" (symbol-name (car parse)) ">\n")))
(defun nnweb-parse-find (type parse &optional maxdepth)