lisp/ChangeLog addition:
[gnus] / lisp / nnweb.el
1 ;;; nnweb.el --- retrieving articles via web search engines
2
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
4 ;;   2004, 2005, 2006, 2007 Free Software Foundation, Inc.
5
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
7 ;; Keywords: news
8
9 ;; This file is part of GNU Emacs.
10
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
14 ;; any later version.
15
16 ;; GNU Emacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 ;; GNU General Public License for more details.
20
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
23 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 ;; Boston, MA 02110-1301, USA.
25
26 ;;; Commentary:
27
28 ;; Note: You need to have `w3' installed for some functions to work.
29
30 ;;; Code:
31
32 (eval-when-compile (require 'cl))
33
34 (require 'nnoo)
35 (require 'message)
36 (require 'gnus-util)
37 (require 'gnus)
38 (require 'nnmail)
39 (require 'mm-util)
40 (require 'mm-url)
41 (eval-and-compile
42   (ignore-errors
43     (require 'url)))
44 (autoload 'w3-parse-buffer "w3-parse")
45
46 (nnoo-declare nnweb)
47
48 (defvoo nnweb-directory (nnheader-concat gnus-directory "nnweb/")
49   "Where nnweb will save its files.")
50
51 (defvoo nnweb-type 'google
52   "What search engine type is being used.
53 Valid types include `google', `dejanews', and `gmane'.")
54
55 (defvar nnweb-type-definition
56   '((google
57      (id . "http://www.google.com/groups?as_umsgid=%s&hl=en&dmode=source")
58      (result . "http://groups.google.com/group/%s/msg/%s?dmode=source")
59      (article . nnweb-google-wash-article)
60      (reference . identity)
61      (map . nnweb-google-create-mapping)
62      (search . nnweb-google-search)
63      (address . "http://groups.google.com/groups")
64      (base    . "http://groups.google.com")
65      (identifier . nnweb-google-identity))
66     (dejanews ;; alias of google
67      (id . "http://www.google.com/groups?as_umsgid=%s&hl=en&dmode=source")
68      (result . "http://groups.google.com/group/%s/msg/%s?dmode=source")
69      (article . nnweb-google-wash-article)
70      (reference . identity)
71      (map . nnweb-google-create-mapping)
72      (search . nnweb-google-search)
73      (address . "http://groups.google.com/groups")
74      (base    . "http://groups.google.com")
75      (identifier . nnweb-google-identity))
76     (gmane
77      (article . nnweb-gmane-wash-article)
78      (id . "http://gmane.org/view.php?group=%s")
79      (reference . identity)
80      (map . nnweb-gmane-create-mapping)
81      (search . nnweb-gmane-search)
82      (address . "http://search.gmane.org/nov.php")
83      (identifier . nnweb-gmane-identity)))
84   "Type-definition alist.")
85
86 (defvoo nnweb-search nil
87   "Search string to feed to Google.")
88
89 (defvoo nnweb-max-hits 999
90   "Maximum number of hits to display.")
91
92 (defvoo nnweb-ephemeral-p nil
93   "Whether this nnweb server is ephemeral.")