File: sb-debugmagazin-de.el

package info (click to toggle)
w3m-el 1.4.569%2B0.20170110-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,780 kB
  • sloc: lisp: 45,666; sh: 515; makefile: 403
file content (105 lines) | stat: -rw-r--r-- 3,981 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
;;; sb-debugmagazin-de.el --- de-bug.de shimbun backend

;; Copyright (C) 2008, 2009 David Engster

;; Author: David Engster <dengste@eml.cc>
;; Keywords: news

;; 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; see the file COPYING.  If not, write to
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

;;; Code:

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

(luna-define-class shimbun-debugmagazin-de (shimbun-rss) ())

(defvar shimbun-debugmagazin-de-group-url-regexp
  '(("frontpage" "http://feeds.feedburner.com/DebugAllInOne"
     ".*/\\(.*\\)\\.html")
    ("musik" "http://feeds.feedburner.com/DebugMusik"
     "musik/\\(.*\\)\\.html")
    ("reviews" "http://feeds.feedburner.com/DebugReviews"
     "reviews/\\(.*\\)\\.html")
    ("magazin" "http://feeds.feedburner.com/DebugMagazin"
     ".*/\\(.*\\)\\.html")
    ("medien" "http://feeds.feedburner.com/DebugMedien"
     ".*/\\(.*\\)\\.html")
    ("podcast" "http://de-bug.de/pod/feed"
     ".*/\\(.*\\)\\.html")
    ("musiktechnik" "http://feeds.feedburner.com/de-bug/SSgQ"
     ".*/\\(.*\\)\\.html")
    ("screen" "http://feeds.feedburner.com/DebugScreen"
     ".*/\\(.*\\)\\.html")
    ("gadgets" "http://feeds.feedburner.com/DebugGadgets"
     ".*/\\(.*\\)\\.html")
    ("games" "http://feeds.feedburner.com/DebugGames"
     ".*/\\(.*\\)\\.html")
    ("mode" "http://feeds.feedburner.com/DebugMode"
     ".*/\\(.*\\)\\.html")))

(defvar shimbun-debugmagazin-de-groups
  (mapcar 'car shimbun-debugmagazin-de-group-url-regexp))
(defvar shimbun-debugmagazin-de-from-address "invalid@debugmagazin.de")

(defvar shimbun-debugmagazin-de-content-start
  "<div class=\"post\"\\( id=\"post-[0-9]+\"\\)?>")

(defvar shimbun-debugmagazin-de-content-end
  "\\(?:<!-- Comment Loop -->\\|<!-- Comment Form -->\\|<div id=\"respond\">\\)")

(defvar shimbun-debugmagazin-de-x-face-alist
  '(("default" . "\
Face: iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAD1BMVEUAAADAwMD/AACAgID
 ////NQiVkAAAAP0lEQVQI12NwgQIGOMOBQYSBBcxwZGFxUQIxXFjQRWBqsGpncXBmYAErdnAAiTC
 bABnOcBEWkBoBRmcGE0ztACqGGS6ml7Z1AAAAAElFTkSuQmCC")))

(luna-define-method shimbun-index-url ((shimbun shimbun-debugmagazin-de))
  (let ((group (shimbun-current-group-internal shimbun)))
    (cadr (assoc group shimbun-debugmagazin-de-group-url-regexp))))

(luna-define-method shimbun-rss-build-message-id ((shimbun
						   shimbun-debugmagazin-de)
						  url date)
  (let* ((group (shimbun-current-group-internal shimbun))
	 (urlregexp
	  (car (last (assoc group
			    shimbun-debugmagazin-de-group-url-regexp)))))
    (unless (string-match urlregexp url)
      (error "Cannot find message-id base"))
    (concat "<" (match-string 1 url) "." group "@debugmagazin.de>")))

(luna-define-method shimbun-get-headers :around ((shimbun
						  shimbun-debugmagazin-de)
						 &optional range)
  ;; Show the group name in the From header.
  (let ((group (shimbun-current-group-internal shimbun))
	(headers (luna-call-next-method))
	from)
    (dolist (header headers headers)
      (setq from (shimbun-header-from header)
	    from (mapconcat (lambda (w)
			      (if (string-match "\\`[^<>@]+@[^<>@]+\\'" w)
				  (concat "<" w ">")
				w))
			    (delete "" (split-string from))
			    " "))
      (unless (string-match (concat "(" (regexp-quote group) ")") from)
	(shimbun-header-set-from header (concat from " (" group ")"))))))

(provide 'sb-debugmagazin-de)

;;; sb-debugmagazin-de.el ends here