The htmls of egroups changed.
authorShengHuo ZHU <zsh@cs.rochester.edu>
Tue, 18 Apr 2000 16:34:32 +0000 (16:34 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Tue, 18 Apr 2000 16:34:32 +0000 (16:34 +0000)
Fixed some bugs in nnwarchive.
Add one-line-cookie patch for w3-4.0pre.46. It is required by some
  backends of nnwarchive and webmail.

contrib/one-line-cookie.diff [new file with mode: 0644]
lisp/ChangeLog
lisp/nnwarchive.el

diff --git a/contrib/one-line-cookie.diff b/contrib/one-line-cookie.diff
new file mode 100644 (file)
index 0000000..1cab64a
--- /dev/null
@@ -0,0 +1,28 @@
+Index: url-cookie.el
+===================================================================
+RCS file: /gd/gnu/anoncvsroot/url/lisp/url-cookie.el,v
+retrieving revision 1.1.1.1
+diff -u -r1.1.1.1 url-cookie.el
+--- url-cookie.el      1999/11/26 12:11:47     1.1.1.1
++++ url-cookie.el      1999/12/10 06:53:05
+@@ -255,6 +255,10 @@
+               (setq retval (cons cur retval))))))
+     retval))
++(defvar url-cookie-multiple-line t
++  "If nil, use one line cookie.
++Some web servers, such as hotmail, only accept one line cookie.")
++
+ ;;;###autolaod
+ (defun url-cookie-generate-header-lines (host path secure)
+   (let* ((cookies (url-cookie-retrieve host path secure))
+@@ -272,7 +276,8 @@
+       (setq cur (car cookies)
+           cookies (cdr cookies)
+           chunk (format "%s=%s" (url-cookie-name cur) (url-cookie-value cur))
+-          retval (if (< 80 (+ (length retval) (length chunk) 4))
++          retval (if (and url-cookie-multiple-line
++                      (< 80 (+ (length retval) (length chunk) 4)))
+                      (concat retval "\r\nCookie: " chunk)
+                    (if retval
+                        (concat retval "; " chunk)
index 6b77e61..0d44718 100644 (file)
@@ -1,3 +1,9 @@
+2000-04-18 12:28:24  Shenghuo ZHU  <zsh@cs.rochester.edu>
+
+       * nnwarchive.el (nnwarchive-type-definition): New egroups html.
+       (nnwarchive-egroups-*): Ditto.
+       (nnwarchive-url): Unibyte buffer and single line cookie.
+
 2000-04-14 18:50:04  Shenghuo ZHU  <zsh@cs.rochester.edu>
 
        * mm-util.el (mm-char-or-char-int-p): New alias.
index 4057db5..e48f9df 100644 (file)
   '((egroups
      (address . "www.egroups.com")
      (open-url 
-      "http://www.egroups.com/register?method=loginAction&email=%s&password=%s" 
+      "http://www.egroups.com/login.cgi?&login_email=%s&login_password=%s" 
       nnwarchive-login nnwarchive-passwd)
      (list-url 
-      "http://www.egroups.com/UserGroupsPage?")
+      "http://www.egroups.com/mygroups")
      (list-dissect . nnwarchive-egroups-list)
      (list-groups . nnwarchive-egroups-list-groups)
      (xover-url 
-      "http://www.egroups.com/group/%s/?fetchForward=1&start=%d" group aux)
+      "http://www.egroups.com/message/%s/%d" group aux)
      (xover-last-url 
-      "http://www.egroups.com/group/%s/?fetchForward=1" group)
+      "http://www.egroups.com/message/%s/" group)
      (xover-page-size . 13)
      (xover-dissect . nnwarchive-egroups-xover)
      (article-url 
-      "http://www.egroups.com/group/%s/%d.html?raw=1" group article)
+      "http://www.egroups.com/message/%s/%d?source=1" group article)
      (article-dissect . nnwarchive-egroups-article)
      (authentication . t)
      (article-offset . 0)
   t)
 
 (deffoo nnwarchive-open-server (server &optional defs connectionless)
+  (nnoo-change-server 'nnwarchive server defs)
   (nnwarchive-init server)
-  (if (nnwarchive-server-opened server)
-      t
-    (nnoo-change-server 'nnwarchive server defs)
-    (when nnwarchive-authentication
-      (setq nnwarchive-login
-           (or nnwarchive-login
-               (read-string
+  (when nnwarchive-authentication
+    (setq nnwarchive-login
+         (or nnwarchive-login
+             (read-string
                 (format "Login at %s: " server)
                 user-mail-address)))
-      (setq nnwarchive-passwd
-           (or nnwarchive-passwd
-               (mail-source-read-passwd
-                (format "Password for %s at %s: " 
-                        nnwarchive-login server)))))
-    (unless nnwarchive-groups
-      (nnwarchive-read-groups))
-    (save-excursion
-      (set-buffer nnwarchive-buffer)
-      (erase-buffer)
-      (if nnwarchive-open-url
-         (nnwarchive-url nnwarchive-open-url))
-      (if nnwarchive-open-dissect
-         (funcall nnwarchive-open-dissect)))
-    t))
+    (setq nnwarchive-passwd
+         (or nnwarchive-passwd
+             (mail-source-read-passwd
+              (format "Password for %s at %s: " 
+                      nnwarchive-login server)))))
+  (unless nnwarchive-groups
+    (nnwarchive-read-groups))
+  (save-excursion
+    (set-buffer nnwarchive-buffer)
+    (erase-buffer)
+    (if nnwarchive-open-url
+       (nnwarchive-url nnwarchive-open-url))
+    (if nnwarchive-open-dissect
+       (funcall nnwarchive-open-dissect)))
+  t)
 
 (nnoo-define-skeleton nnwarchive)
 
     expr)))
 
 (defun nnwarchive-url (xurl)
-  (let ((url-confirmation-func 'identity))
-    (cond 
-     ((eq (car xurl) 'post)
-      (pop xurl)
-      (nnwarchive-fetch-form (car xurl) (nnwarchive-eval (cdr xurl))))
-     (t
-      (nnweb-insert (apply 'format (nnwarchive-eval xurl)))))))
-
+  (mm-with-unibyte-current-buffer
+    (let ((url-confirmation-func 'identity)
+         (url-cookie-multiple-line nil))
+      (cond 
+       ((eq (car xurl) 'post)
+       (pop xurl)
+       (nnwarchive-fetch-form (car xurl) (nnwarchive-eval (cdr xurl))))
+       (t
+       (nnweb-insert (apply 'format (nnwarchive-eval xurl))))))))
+  
 (defun nnwarchive-generate-active ()
   (save-excursion
     (set-buffer nntp-server-buffer)
        (erase-buffer)
        (nnwarchive-url nnwarchive-xover-last-url)
        (goto-char (point-min))
-       (when (re-search-forward "of \\([0-9]+\\)</title>" nil t)
+       (when (re-search-forward "of \\([0-9]+\\)[ \t\n\r]*</title>" nil t)
          (setq articles (string-to-number (match-string 1)))) 
        (let ((elem (assoc group nnwarchive-groups)))
          (if elem
        group description elem articles)
     (goto-char (point-min))
     (while 
-       (re-search-forward
-        "/group/\\([^/]+\\)/info\\.html[^>]+>[^>]+>[\040\t]*-[\040\t]*\\([^<]+\\)<"
-        nil t)
+       (re-search-forward "href=\"/group/\\([^/\"\> ]+\\)" nil t)
       (setq group (match-string 1)
            description (match-string 2))
-      (forward-line 1)
-      (when (re-search-forward ">\\([0-9]+\\)<" nil t)
-       (setq articles (string-to-number (match-string 1)))) 
       (if (setq elem (assoc group nnwarchive-groups))
-         (setcar (cdr elem) articles)
+         (setcar (cdr elem) 0)
        (push (list group articles description) nnwarchive-groups))))
   t)
 
   (let (article subject from date)
     (goto-char (point-min))
     (while (re-search-forward
-           "<a href=\"/group/\\([^/]+\\)/\\([0-9]+\\)\\.html[^>]+>\\([^<]+\\)<"
+           "<a href=\"/group/\\([^/]+\\)/\\([0-9]+\\)[^>]+>\\([^<]+\\)<"
            nil t)
       (setq group  (match-string 1)
            article (string-to-number (match-string 2))