Require cl when compiling.
[gnus] / lisp / nnwarchive.el
1 ;;; nnwarchive.el --- interfacing with web archives
2 ;; Copyright (C) 1999, 2000 Free Software Foundation, Inc.
3
4 ;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
5 ;; Keywords: news egroups mail-archive
6
7 ;; This file is part of GNU Emacs.
8
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published
11 ;; by the Free Software Foundation; either version 2, or (at your
12 ;; option) any later version.
13
14 ;; GNU Emacs is distributed in the hope that it will be useful, but
15 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 ;; General Public License for more details.
18
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 ;; Boston, MA 02111-1307, USA.
23
24 ;;; Commentary:
25
26 ;; Note: You need to have `url' (w3 0.46) or greater version
27 ;; installed for this backend to work.
28
29 ;; Todo: 
30 ;; 1. To support more web archives.
31 ;; 2. Generalize webmail to other MHonArc archive.
32
33 ;;; Code:
34
35 (eval-when-compile (require 'cl))
36
37 (require 'nnoo)
38 (require 'message)
39 (require 'gnus-util)
40 (require 'gnus)
41 (require 'gnus-bcklg)
42 (require 'nnmail)
43 (require 'mm-util)
44 (require 'mail-source)
45 (eval-when-compile
46   (ignore-errors
47     (require 'w3)
48     (require 'url)
49     (require 'w3-forms)
50     (require 'nnweb)))
51 ;; Report failure to find w3 at load time if appropriate.
52 (eval '(progn
53          (require 'w3)
54          (require 'url)
55          (require 'w3-forms)
56          (require 'nnweb)))
57
58 (nnoo-declare nnwarchive)
59
60 (defvar nnwarchive-type-definition
61   '((egroups
62      (address . "www.egroups.com")
63      (open-url 
64       "http://www.egroups.com/login.cgi?&login_email=%s&login_password=%s" 
65       nnwarchive-login nnwarchive-passwd)
66      (list-url 
67       "http://www.egroups.com/mygroups")
68      (list-dissect . nnwarchive-egroups-list)
69      (list-groups . nnwarchive-egroups-list-groups)
70      (xover-url 
71       "http://www.egroups.com/messages/%s/%d" group aux)
72      (xover-last-url 
73       "http://www.egroups.com/messages/%s/" group)
74      (xover-page-size . 13)
75      (xover-dissect . nnwarchive-egroups-xover)
76      (article-url 
77       "http://www.egroups.com/message/%s/%d?source=1" group article)
78      (article-dissect . nnwarchive-egroups-article)
79      (authentication . t)
80      (article-offset . 0)
81      (xover-files . nnwarchive-egroups-xover-files))
82     (mail-archive
83      (address . "www.mail-archive.com")
84      (open-url)
85      (list-url 
86       "http://www.mail-archive.com/lists.html")
87      (list-dissect . nnwarchive-mail-archive-list)
88      (list-groups . nnwarchive-mail-archive-list-groups)
89      (xover-url 
90       "http://www.mail-archive.com/%s/mail%d.html" group aux)
91      (xover-last-url 
92       "http://www.mail-archive.com/%s/maillist.html" group)
93      (xover-page-size)
94      (xover-dissect . nnwarchive-mail-archive-xover)
95      (article-url 
96       "http://www.mail-archive.com/%s/msg%05d.html" group article1)
97      (article-dissect . nnwarchive-mail-archive-article)
98      (xover-files . nnwarchive-mail-archive-xover-files)
99      (authentication)
100      (article-offset . 1))))
101
102 (defvar nnwarchive-default-type 'egroups)
103
104 (defvoo nnwarchive-directory (nnheader-concat gnus-directory "warchive/")
105   "Where nnwarchive will save its files.")
106
107 (defvoo nnwarchive-type nil
108     "The type of nnwarchive.")
109
110 (defvoo nnwarchive-address ""
111   "The address of nnwarchive.")
112
113 (defvoo nnwarchive-login nil
114   "Your login name for the group.")
115
116 (defvoo nnwarchive-passwd nil
117   "Your password for the group.")
118
119 (defvoo nnwarchive-groups nil)
120
121 (defvoo nnwarchive-headers-cache nil)
122
123 (defvoo nnwarchive-authentication nil)
124
125 (defvoo nnwarchive-nov-is-evil nil)