[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Shimbun backend for FFII



Hi,

I received the attached message.  I will be willing to add sb-ffii.el
to our CVS repository.  Before adding it, I would like to mention
several suggestions.

I have just checked the WEB page <http://www.ffii.org/news/rss/>, and
found more RSS feeds than the current sb-ffii.el supports.  Can you
add other RSS feeds and improve group names?  SwpatcninoEn and
SwpatcninoEn-ffii are difficult to imagine groups' contents.  Here is
my proposal.

    SwpatcninoEn      => softwarepatent
    SwpatcninoEn-ffii => softwarepatent.ffii
    SwpatcninoDe      => softwarepatent.de
    SwpatcninoDe-ffii => softwarepatent.de.ffii
    ...

You can remove `shimbun-ffii-content-start' and `shimbun-ffii-content-end'
safely.  When they are not specified, Shimbun library will remove no
snippet from retrieved pages when makeing articles.

You can remove `shimbun-ffii-server-name' also.

You should add a copyright header to the file as follows:

    Copyright (C) 2005 ....

I wish that my suggestions may help you to improve your program.

Regards,

-- 
TSUCHIYA Masatoshi
--- Begin Message ---
Hi,

below you find a Shimbun backend for FFII RSS feeds.  Would it be
possible to include that in future versions of EMACS-W3M?

Felix

;;; sb-ffii.el --- shimbun backend for <http://www.ffii.org/news/rss/>

;; Authors: 
;; * Felix E. Klee <felix.klee@inka.de>
;; * Andreas Seltenreich <seltenreich@gmx.de> (author of sb-n24-de.el
;;   which was used as a base for this module)
;; Keywords: news
;; Created: Feb 07, 2005

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program; if not, you can either send email to this
;; program's maintainer or write to: The Free Software Foundation,
;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.

;;; Code:

(require 'shimbun)
(require 'sb-rss)

(luna-define-class shimbun-ffii (shimbun-rss) ())

(defvar shimbun-ffii-groups
  '("SwpatcninoEn"
    "SwpatcninoEn-ffii"))

(defvar shimbun-ffii-content-start "<html>")
(defvar shimbun-ffii-content-end "</html>")
(defvar shimbun-ffii-server-name "FFII")
(defvar shimbun-ffii-from-address "info@ffii.org")

(luna-define-method shimbun-headers :before ((shimbun shimbun-ffii)
					     &rest range)
  shimbun)

(luna-define-method shimbun-groups ((shimbun shimbun-ffii))
  shimbun-ffii-groups)

(luna-define-method shimbun-rss-build-message-id
  ((shimbun shimbun-ffii) url date)
  (let (page host datedesc)
    (unless (string-match "http:\\/\\/" url)
      (error "Cannot parse URL for message-id base"))
    (setq host (match-string-no-properties 1 url)
	  page (match-string-no-properties 2 url))
    (unless (string-match "\\([0-9][0-9][0-9][0-9]\\)-\\([0-9][0-9]\\)-\\([0-9][0-9]\\)" date)
      (error "Cannot parse date for message-id base"))
    (setq datedesc (concat (match-string-no-properties 1 date)
			   (match-string-no-properties 2 date)
			   (match-string-no-properties 3 date)
			   (match-string-no-properties 4 date)
			   (match-string-no-properties 5 date)))
    (format "<%s%%%s@%s>" datedesc page host)))

(luna-define-method shimbun-index-url ((shimbun shimbun-ffii))
  (concat "http://www.ffii.org/news/rss/"
	  (shimbun-current-group-internal shimbun)
      ".rss"))

(provide 'sb-ffii)

;;; sb-ffii.el ends here
--- End Message ---