-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.py
75 lines (65 loc) · 2.23 KB
/
config.py
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
#!/usr/bin/env python
#
# Python script to convert from RSS to Maildir (config file)
#
# Copyright (C) 2015-2021 Jochen Sprickerhof
#
# 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.
from re import sub
from typing import Any
maildir = ".maildir/Feeds"
def tagesschau(entry) -> bool:
if ".de/sport" in entry.link or ".de/wirtschaft/finanzen/" in entry.link:
return True
entry.summary = sub(r"<a href[^>]*><img [^>]*></a>", "", entry.summary)
entry.summary = sub(
r"<a href[^>]*>Meldung bei www.tagesschau.de lesen</a>", "", entry.summary
)
entry.summary = entry.summary.replace("<br /><br />", "")
return False
def heise(entry) -> bool:
return entry.title.startswith("Anzeige:")
def heise_open(entry) -> bool:
entry.id = sub(r".*-([0-9]*).html", r"http://heise.de/-\1", entry.id)
return False
feeds: list[Any] = [
{
"url": "https://www.heise.de/rss/heise-atom.xml",
"title": "Heise",
"filter": heise,
"use_uid": True,
},
{
"url": "https://www.heise.de/thema/Linux-und-Open-Source?view=atom",
"title": "Heise",
"filter": heise_open,
"use_uid": True,
},
{
"url": "https://www.heise.de/security/rss/news-atom.xml",
"title": "Heise",
"use_uid": True,
},
{
"url": "https://www.tagesschau.de/xml/rss2",
"filter": tagesschau,
"use_uid": True,
},
{"url": "https://blog.fefe.de/rss.xml?html", "use_header": False},
{
"url": "https://github.com/jspricke/rss2maildir/commits/master.atom",
"title": "rss2maildir",
},
"https://www.daemonology.net/hn-daily/index.rss",
]