27 |
|
|
28 |
;; Note: You need to have `w3' installed for some functions to work. |
;; Note: You need to have `w3' installed for some functions to work. |
29 |
|
|
30 |
|
;; FIXME: Due to changes in the HTML output of Google Groups and Gmane, stuff |
31 |
|
;; related to web groups (gnus-group-make-web-group) doesn't work anymore. |
32 |
|
|
33 |
|
;; Fetching an article by MID (cf. gnus-refer-article-method) over Google |
34 |
|
;; Groups should work. |
35 |
|
|
36 |
;;; Code: |
;;; Code: |
37 |
|
|
38 |
(eval-when-compile (require 'cl)) |
(eval-when-compile (require 'cl)) |
60 |
|
|
61 |
(defvar nnweb-type-definition |
(defvar nnweb-type-definition |
62 |
'((google |
'((google |
63 |
(article . ignore) |
(id . "http://www.google.com/groups?as_umsgid=%s&hl=en&dmode=source") |
64 |
(id . "http://groups.google.de/groups?selm=%s&output=gplain") |
(article . nnweb-google-wash-article) |
65 |
(reference . identity) |
(reference . identity) |
66 |
(map . nnweb-google-create-mapping) |
(map . nnweb-google-create-mapping) |
67 |
(search . nnweb-google-search) |
(search . nnweb-google-search) |
68 |
(address . "http://groups.google.de/groups") |
(address . "http://groups.google.com/groups") |
69 |
(base . "http://groups.google.de") |
(base . "http://groups.google.com") |
70 |
(identifier . nnweb-google-identity)) |
(identifier . nnweb-google-identity)) |
71 |
(dejanews ;; alias of google |
(dejanews ;; alias of google |
72 |
(article . ignore) |
(article . ignore) |
312 |
(current-buffer)))))) |
(current-buffer)))))) |
313 |
|
|
314 |
;;; |
;;; |
315 |
;;; Deja bought by google.com |
;;; groups.google.com |
316 |
;;; |
;;; |
317 |
|
|
318 |
(defun nnweb-google-wash-article () |
(defun nnweb-google-wash-article () |
319 |
(let ((case-fold-search t) url) |
;; We have Google's masked e-mail addresses here. :-/ |
320 |
(goto-char (point-min)) |
(let ((case-fold-search t)) |
|
(re-search-forward "^<pre>" nil t) |
|
|
(narrow-to-region (point-min) (point)) |
|
|
(search-backward "<table " nil t 2) |
|
|
(delete-region (point-min) (point)) |
|
|
(if (re-search-forward "Search Result [0-9]+" nil t) |
|
|
(replace-match "")) |
|
|
(if (re-search-forward "View complete thread ([0-9]+ articles?)" nil t) |
|
|
(replace-match "")) |
|
321 |
(goto-char (point-min)) |
(goto-char (point-min)) |
322 |
(while (search-forward "<br>" nil t) |
(delete-region (point-min) |
323 |
(replace-match "\n")) |
(1+ (re-search-forward "^<pre>" nil t))) |
|
(mm-url-remove-markup) |
|
324 |
(goto-char (point-min)) |
(goto-char (point-min)) |
325 |
(while (re-search-forward "^[ \t]*\n" nil t) |
(delete-region (- (re-search-forward "^</pre>" nil t) (length "</pre>")) |
326 |
(replace-match "")) |
(point-max)) |
327 |
(goto-char (point-max)) |
(mm-url-decode-entities))) |
|
(insert "\n") |
|
|
(widen) |
|
|
(narrow-to-region (point) (point-max)) |
|
|
(search-forward "</pre>" nil t) |
|
|
(delete-region (point) (point-max)) |
|
|
(mm-url-remove-markup) |
|
|
(widen))) |
|
328 |
|
|
329 |
(defun nnweb-google-parse-1 (&optional Message-ID) |
(defun nnweb-google-parse-1 (&optional Message-ID) |
330 |
(let ((i 0) |
(let ((i 0) |