Skip to content

Commit

Permalink
improve feed metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
eikowagenknecht committed Feb 25, 2022
1 parent d22b0ff commit b7499e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This project is in ongoing development, not yet usable for the average user and
### TODO

- [ ] Check TODO comments in code.
- [ ] Before open-sourcing: Make URLs in feed customizable

### Features

Expand Down
12 changes: 9 additions & 3 deletions app/feed.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ def generate_feed(offers: list[LootOffer], out_file: Path) -> None:
# XML
feed_generator.language("en")
# Atom Needed
feed_generator.id("https://phenx.de/loot")
feed_generator.title("Free Games and Loot")
if out_file.name == "gameloot.xml":
feed_generator.id("https://phenx.de/loot")
feed_generator.title("Free Games and Loot")
else:
# Use the part between "gameloot_" and ".xml" as the feed id
subfeed = out_file.name.split("_", 1)[1][0:-4]
feed_generator.id("https://phenx.de/loot/" + subfeed)
feed_generator.title("Free Offers: " + subfeed.replace("_", " / ").title())
feed_generator.updated(last_updated)
# Atom Recommended
feed_generator.link(rel="self", href="https://feed.phenx.de/gameloot.xml")
feed_generator.link(rel="self", href="https://feed.phenx.de/" + out_file.name)
feed_generator.link(rel="alternate", href="https://phenx.de/loot")
feed_generator.author(
{
Expand Down

0 comments on commit b7499e3

Please sign in to comment.