Change for ZDNet.
authortsuchiya <tsuchiya>
Sat, 19 Aug 2000 07:27:32 +0000 (07:27 +0000)
committertsuchiya <tsuchiya>
Sat, 19 Aug 2000 07:27:32 +0000 (07:27 +0000)
ChangeLog
lisp/nnshimbun.el

index 9adbdc6..632a5c5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2000-08-19  TSUCHIYA Masatoshi  <tsuchiya@pine.kuee.kyoto-u.ac.jp>
+
+       * nnshimbun.el (nnshimbun-type-definition): Follow changes of ZDNet.
+       (nnshimbun-make-text-or-html-contents): Ditto.
+       (nnshimbun-make-html-contents): Ditto.
+
 2000-08-18  TSUCHIYA Masatoshi  <tsuchiya@pine.kuee.kyoto-u.ac.jp>
             Akihiro Arisawa  <ari@atesoft.advantest.co.jp>
 
index 3ca4016..be376c6 100644 (file)
      (index-url      . nnshimbun-url)
      (from-address   . "zdnn@softbank.co.jp")
      (make-contents  . nnshimbun-make-html-contents)
-     (contents-start . "<!--BODY-->")
-     (contents-end   . "<!--BODYEND-->"))
+     (contents-start . "\\(<!--BODY-->\\|[0-9]+\e$BG/\e(B[0-9]+\e$B7n\e(B[0-9]+\e$BF|\e(B[^<]*</font></td>[ \t\r\f\n]*</tr>[ \t\r\f\n]*</table>[ \t\r\f\n]*\\(</p>\\)?\\)")
+     (contents-end   . "\\(<!--BODYEND-->\\|<div align=\"right\">\\|<\\(b\\|strong\\)>\\[</\\2>[^<]*<\\2>ZDNet/\\(JAPAN\\|USA\\)\\]\\(<[^>]+>\\)?</\\2>\\)"))
     ("mew"
      (url . "http://www.mew.org/archive/")
      (groups ,@(mapcar #'car nnshimbun-mew-groups))
@@ -748,11 +748,11 @@ is enclosed by at least one regexp grouping construct."
 
 (defun nnshimbun-make-text-or-html-contents (header &optional x-face)
   (let ((case-fold-search t) (html t) (start))
-    (when (and (search-forward nnshimbun-contents-start nil t)
+    (when (and (re-search-forward nnshimbun-contents-start nil t)
               (setq start (point))
-              (search-forward nnshimbun-contents-end nil t))
+              (re-search-forward nnshimbun-contents-end nil t))
+      (delete-region (match-beginning 0) (point-max))
       (delete-region (point-min) start)
-      (delete-region (- (point) (length nnshimbun-contents-end)) (point-max))
       (nnshimbun-shallow-rendering)
       (setq html nil))
     (goto-char (point-min))
@@ -769,11 +769,11 @@ is enclosed by at least one regexp grouping construct."
 
 (defun nnshimbun-make-html-contents (header &optional x-face)
   (let (start)
-    (when (and (search-forward nnshimbun-contents-start nil t)
+    (when (and (re-search-forward nnshimbun-contents-start nil t)
               (setq start (point))
-              (search-forward nnshimbun-contents-end nil t))
-      (delete-region (point-min) start)
-      (delete-region (- (point) (length nnshimbun-contents-end)) (point-max)))
+              (re-search-forward nnshimbun-contents-end nil t))
+      (delete-region (match-beginning 0) (point-max))
+      (delete-region (point-min) start))
     (goto-char (point-min))
     (nnshimbun-insert-header header)
     (insert "Content-Type: text/html; charset=ISO-2022-JP\n"