;;; sb-perlentaucher-de.el --- perlentaucher.de shimbun backend ;; This 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 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 GNU Emacs; see the file COPYING. If not, 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-perlentaucher-de (shimbun-rss) ()) (defvar shimbun-perlentaucher-de-url "http://rss.perlentaucher.de") (defvar shimbun-perlentaucher-de-groups '("aktuell")) (defvar shimbun-perlentaucher-de-from-address "invalid@perlentaucher.de") (defvar shimbun-perlentaucher-de-content-start "
") (defvar shimbun-perlentaucher-de-content-end "
") (luna-define-method shimbun-index-url ((shimbun shimbun-perlentaucher-de)) shimbun-perlentaucher-de-url) (luna-define-method shimbun-clear-contents :before ((shimbun shimbun-perlentaucher-de) header) ;; search teaser for real article url and load it (goto-char (point-min)) (re-search-forward ".*mehr lesen" (point-max) t) (let ((url (format "http://www.perlentaucher.de%s" (match-string 1)))) (erase-buffer) (shimbun-retrieve-url url)) ;; remove stuff (shimbun-remove-tags "
" "Merkzettel") (shimbun-remove-tags "
" "
") (shimbun-remove-tags "" "")) (luna-define-method shimbun-rss-build-message-id ((shimbun shimbun-perlentaucher-de) url date) (unless (progn (message url) (string-match "rssteaser/\\(.*\\)\\.html" url)) (error "Cannot find message-id base")) (message (concat "<" (match-string 1 url) "@perlentaucher.de>")) (concat "<" (match-string 1 url) "@perlentaucher.de>")) (provide 'sb-perlentaucher-de)