1;;; sb-redhat.el --- shimbun backend for sources.redhat.com mailing lists
2
3;; Copyright (C) 2002, 2003, 2019 OHASHI Akira <bg66@koka-in.org>
4
5;; Author: OHASHI Akira <bg66@koka-in.org>
6;; Keywords: news
7
8;; This file is a part of shimbun.
9
10;; This program is free software; you can redistribute it and/or modify
11;; it under the terms of the GNU General Public License as published by
12;; the Free Software Foundation; either version 2, or (at your option)
13;; any later version.
14
15;; This program is distributed in the hope that it will be useful,
16;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18;; GNU General Public License for more details.
19
20;; You should have received a copy of the GNU General Public License
21;; along with this program; see the file COPYING.  If not, write to
22;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA.
24
25;;; Commentary:
26
27;;; Code:
28
29(eval-when-compile (require 'cl-lib)) ;; cl-incf
30(require 'shimbun)
31(require 'sb-mhonarc)
32
33(luna-define-class shimbun-redhat (shimbun-mhonarc) ())
34
35(defvar shimbun-redhat-url "http://sources.redhat.com/ml/")
36(defvar shimbun-redhat-groups
37  '("automake" "bug-automake" "automake-prs" "automake-cvs" "binutils"
38    "binutils-cvs" "c++-embedded" "crossgcc" "cgen" "cgen-prs" "cgen-cvs"
39    "cygwin" "cygwin-xfree" "cygwin-announce" "cygwin-xfree-announce"
40    "cygwin-apps" "cygwin-patches" "cygwin-developers" "cygwin-cvs"
41    "cygwin-apps-cvs" "docbook-tools-discuss" "docbook-tools-announce"
42    "docbook-tools-cvs" "docbook" "dssslist" "sgml-tools" "docbook-apps"
43    "ecos-announce" "ecos-devel" "ecos-discuss" "ecos-maintainers"
44    "ecos-patches" "elix" "elix-announce" "gdb" "gdb-announce" "gdb-testers"
45    "gdb-testresults" "gdb-patches" "gdb-cvs" "bug-gdb" "gdb-prs" "libc-alpha"
46    "libc-hacker" "bug-glibc" "glibc-cvs" "glibc-linux" "bug-gnats"
47    "gnats-devel" "gnats-announce" "gnats-cvs" "gsl-discuss" "gsl-announce"
48    "gsl-cvs" "guile" "guile-emacs" "guile-prs" "guile-gtk" "bug-guile"
49    "guile-cvs" "guile-emacs-cvs" "insight" "insight-announce" "insight-prs"
50    "installshell" "inti" "kawa" "libffi-discuss" "libffi-announce"
51    "libstdc++" "libstdc++-cvs" "libstdc++-prs" "mauve-discuss"
52    "mauve-announce" "newlib" "pthreads-win32" "rhdb" "rhdb-announce"
53    "rhug-rhats" "rpm2html-cvs" "rpm2html-prs" "rpm2html" "sid" "sid-announce"
54    "sid-cvs" "sourcenav" "sourcenav-announce" "sourcenav-prs" "win32-x11"
55    "xconq7" "xconq-announce" "xconq-cvs"))
56(defvar shimbun-redhat-coding-system 'iso-8859-1)
57(defvar shimbun-redhat-reverse-flag t)
58(defvar shimbun-redhat-litemplate-regexp
59  "<td align=\"left\"><b><a name=\"\\([0-9]+\\)\" href=\"\\(msg[0-9]+\.html\\)\">\\([^<]+\\)</a></b></td>\n<td align=\"right\">\\([^<]+\\)</td>")
60(defvar shimbun-redhat-litemplate-regexp-old
61  " </tt><b><a name=\"\\([0-9]+\\)\" href=\"\\(msg[0-9]+\.html\\)\">\\([^<]+\\)</a></b><tt> </tt>\\(.+\\)")
62
63(luna-define-method shimbun-index-url ((shimbun shimbun-redhat))
64  (concat (shimbun-url-internal shimbun)
65	  (shimbun-current-group-internal shimbun) "/"))
66(luna-define-method shimbun-reply-to ((shimbun shimbun-redhat))
67  (concat (shimbun-current-group-internal shimbun) "@redhat.com"))
68
69(luna-define-method shimbun-get-headers ((shimbun shimbun-redhat)
70					 &optional range)
71  (let ((case-fold-search t)
72	(pages (shimbun-header-index-pages range))
73	(count 0)
74	headers months)
75    (goto-char (point-min))
76    (catch 'stop
77      (while (and (if pages (<= (cl-incf count) pages) t)
78		  (re-search-forward "   <li><a href=\"\\([0-9]+\\(-[0-9q][0-9]\\)?\\)/\">" nil t)
79		  (push (match-string 1) months)))
80      (setq months (nreverse months))
81      (dolist (month months)
82	(let ((url (concat (shimbun-index-url shimbun) month "/")))
83	  (when (= (string-match "[0-9]+\\(-q[0-9]\\)?\\'" month) 0)
84	    (shimbun-mhonarc-set-litemplate-regexp-internal
85	     shimbun shimbun-redhat-litemplate-regexp-old))
86	  (shimbun-retrieve-url url t)
87	  (shimbun-mhonarc-get-headers shimbun url headers month))))
88    headers))
89
90(provide 'sb-redhat)
91
92;;; sb-redhat.el ends here
93