Skip to content

Commit 09509e6

Browse files
committed
Fix: deal with feeds that don't have the updated property
1 parent d5633e2 commit 09509e6

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

example/uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "django-rss-filter"
3-
version = "0.3.0"
3+
version = "0.4.0"
44
description = "Filter public RSS feeds, remove articles that contain certain keywords or categories."
55
authors = [
66
{name = "Kevin Renskers", email = "[email protected]"},

rssfilter/utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ def filter_feed(feed_body: str, filtered_words: str, filtered_categories: str) -
2121
fg.link(href=feed.feed.link)
2222
fg.description(feed.feed.get("description", "Filtered feed"))
2323
fg.language(feed.feed.get("language", "en"))
24-
fg.updated(feed.feed.updated)
24+
25+
if updated := feed.feed.get("updated"):
26+
fg.updated(updated)
27+
28+
if published := feed.feed.get("published"):
29+
fg.pubDate(published)
2530

2631
filtered_words_list = [item.strip().lower() for item in filtered_words.split(",") if item.strip()]
2732
filtered_categories_list = [item.strip().lower() for item in filtered_categories.split(",") if item.strip()]

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)