Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zackees/gen-rss
Generates an RSS feed, as sampled from wordpress sites
https://github.com/zackees/gen-rss
Last synced: about 1 month ago
JSON representation
Generates an RSS feed, as sampled from wordpress sites
- Host: GitHub
- URL: https://github.com/zackees/gen-rss
- Owner: zackees
- License: mit
- Created: 2022-05-29T23:49:13.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-05-30T02:17:09.000Z (over 2 years ago)
- Last Synced: 2024-11-20T05:30:43.891Z (about 2 months ago)
- Language: Python
- Size: 10.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gen-rss
Yet another generator for rss.
Generates an RSS feed that can be read by the likes of feedparser.
The RSS feed format was lifted from a word press site.
Pull requests are welcome.
# API Example
```
from gen_rss import Item, gen_rssdef test_video_list_to_rss():
"""Tests that the rss generator works with custom data that can be parsed by feedparser."""
datetime_iso = "2020-01-01T00:00:00+00:00"
items: List[Item] = [
Item(
title="test_title",
link="test_link",
description="test_description",
date_published=datetime_iso,
channel_name="test_channel_name",
),
]
rss_str = gen_rss(
items=items,
feed_title="Test Feed",
feed_link="https://blast.video/whatever/rss",
feed_description="feed description",
)
print(rss_str)
feed = feedparser.parse(rss_str)
self.assertEqual(len(feed.entries), 1)
item = feed.entries[0]
self.assertEqual(item.title, "test_title")
self.assertEqual(item.link, "test_link")
self.assertEqual(item.description, "test_description")
self.assertEqual(item.published, datetime_iso)
self.assertEqual(item.author, "test_channel_name")
```