aboutsummaryrefslogtreecommitdiff
path: root/afeedprocessor/anitemprocessor.py
diff options
context:
space:
mode:
Diffstat (limited to 'afeedprocessor/anitemprocessor.py')
-rw-r--r--afeedprocessor/anitemprocessor.py47
1 files changed, 47 insertions, 0 deletions
diff --git a/afeedprocessor/anitemprocessor.py b/afeedprocessor/anitemprocessor.py
new file mode 100644
index 0000000..3f0eabc
--- /dev/null
+++ b/afeedprocessor/anitemprocessor.py
@@ -0,0 +1,47 @@
1import PyRSS2Gen
2
3
4class ItemProcessor:
5 def get_title(self, title, item):
6 return title
7
8 def get_link(self, link, item):
9 return link
10
11 def get_description(self, description, item):
12 return description
13
14 def get_author(self, author, item):
15 return author
16
17 def get_categories(self, categories, item):
18 return categories
19
20 def get_comments(self, comments, item):
21 return comments
22
23 def get_enclosure(self, enclosure, item):
24 return enclosure
25
26 def get_guid(self, guid, item):
27 return guid
28
29 def get_pub_date(self, pub_date, item):
30 return pub_date
31
32 def get_source(self, source, item):
33 return source
34
35 def process(self, item: PyRSS2Gen.RSSItem):
36 return PyRSS2Gen.RSSItem(
37 title=self.get_title(item.title, item),
38 link=self.get_link(item.link, item),
39 description=self.get_description(item.description, item),
40 author=self.get_author(item.author, item),
41 categories=self.get_categories(item.categories, item),
42 comments=self.get_comments(item.comments, item),
43 enclosure=self.get_enclosure(item.enclosure, item),
44 guid=self.get_guid(item.guid, item),
45 pubDate=self.get_pub_date(item.pubDate, item),
46 source=self.get_source(item.source, item)
47 )