24 |
|
|
25 |
;;; Commentary: |
;;; Commentary: |
26 |
|
|
|
;; Note: You need to have `url' and `w3' installed for this |
|
|
;; backend to work. |
|
|
|
|
27 |
;;; Code: |
;;; Code: |
28 |
|
|
29 |
(eval-when-compile (require 'cl)) |
(eval-when-compile (require 'cl)) |
30 |
|
|
31 |
(require 'nnoo) |
(require 'nnoo) |
32 |
(eval-when-compile |
(require 'mm-url) |
33 |
(ignore-errors |
(require 'nnweb) |
|
(require 'nnweb)) ; requires W3 |
|
|
(autoload 'url-insert-file-contents "nnweb")) |
|
34 |
|
|
35 |
(nnoo-declare nnlistserv |
(nnoo-declare nnlistserv |
36 |
nnweb) |
nnweb) |
93 |
(when (funcall (nnweb-definition 'search) page) |
(when (funcall (nnweb-definition 'search) page) |
94 |
;; Go through all the article hits on this page. |
;; Go through all the article hits on this page. |
95 |
(goto-char (point-min)) |
(goto-char (point-min)) |
96 |
(nnweb-decode-entities) |
(mm-url-decode-entities) |
97 |
(goto-char (point-min)) |
(goto-char (point-min)) |
98 |
(while (re-search-forward "^<li> *<a href=\"\\([^\"]+\\)\"><b>\\([^\\>]+\\)</b></a> *<[^>]+><i>\\([^>]+\\)<" nil t) |
(while (re-search-forward "^<li> *<a href=\"\\([^\"]+\\)\"><b>\\([^\\>]+\\)</b></a> *<[^>]+><i>\\([^>]+\\)<" nil t) |
99 |
(setq url (match-string 1) |
(setq url (match-string 1) |
119 |
(let ((case-fold-search t) |
(let ((case-fold-search t) |
120 |
(headers '(sent name email subject id)) |
(headers '(sent name email subject id)) |
121 |
sent name email subject id) |
sent name email subject id) |
122 |
(nnweb-decode-entities) |
(mm-url-decode-entities) |
123 |
(while headers |
(while headers |
124 |
(goto-char (point-min)) |
(goto-char (point-min)) |
125 |
(re-search-forward (format "<!-- %s=\"\\([^\"]+\\)" (car headers)) nil t) |
(re-search-forward (format "<!-- %s=\"\\([^\"]+\\)" (car headers)) nil t) |
130 |
(goto-char (point-max)) |
(goto-char (point-max)) |
131 |
(search-backward "<!-- body" nil t) |
(search-backward "<!-- body" nil t) |
132 |
(delete-region (point-max) (progn (beginning-of-line) (point))) |
(delete-region (point-max) (progn (beginning-of-line) (point))) |
133 |
(nnweb-remove-markup) |
(mm-url-remove-markup) |
134 |
(goto-char (point-min)) |
(goto-char (point-min)) |
135 |
(insert (format "From: %s <%s>\n" name email) |
(insert (format "From: %s <%s>\n" name email) |
136 |
(format "Subject: %s\n" subject) |
(format "Subject: %s\n" subject) |
138 |
(format "Date: %s\n\n" sent)))) |
(format "Date: %s\n\n" sent)))) |
139 |
|
|
140 |
(defun nnlistserv-kk-search (search) |
(defun nnlistserv-kk-search (search) |
141 |
(url-insert-file-contents |
(mm-url-insert |
142 |
(concat (format (nnweb-definition 'address) search) |
(concat (format (nnweb-definition 'address) search) |
143 |
(nnweb-definition 'index))) |
(nnweb-definition 'index))) |
144 |
t) |
t) |