+ RSS Feeds Documentation
+ This page lists all available RSS feeds for TTVDrops.
+
+ Available RSS Feeds
+
+
+
+{% endblock content %}
diff --git a/twitch/feeds.py b/twitch/feeds.py
new file mode 100644
index 0000000..a1670e4
--- /dev/null
+++ b/twitch/feeds.py
@@ -0,0 +1,78 @@
+from __future__ import annotations
+
+from django.contrib.syndication.views import Feed
+from django.urls import reverse
+
+from twitch.models import DropCampaign, Game, Organization
+
+
+class OrganizationFeed(Feed):
+ """RSS feed for latest organizations."""
+
+ title = "TTVDrops Organizations"
+ link = "/organizations/"
+ description = "Latest organizations on TTVDrops"
+
+ def items(self) -> list[Organization]:
+ """Return the latest 100 organizations."""
+ return list(Organization.objects.order_by("-id")[:100])
+
+ def item_title(self, item: Organization) -> str:
+ """Return the organization name as the item title."""
+ return item.name
+
+ def item_description(self, item: Organization) -> str:
+ """Return a description of the organization."""
+ return f"Organization {item.name}"
+
+ def item_link(self, item: Organization) -> str:
+ """Return the link to the organization detail."""
+ return reverse("twitch:organization_detail", args=[item.pk])
+
+
+class GameFeed(Feed):
+ """RSS feed for latest games."""
+
+ title = "TTVDrops Games"
+ link = "/games/"
+ description = "Latest games on TTVDrops"
+
+ def items(self) -> list[Game]:
+ """Return the latest 100 games."""
+ return list(Game.objects.order_by("-id")[:100])
+
+ def item_title(self, item: Game) -> str:
+ """Return the game name as the item title."""
+ return str(item)
+
+ def item_description(self, item: Game) -> str:
+ """Return a description of the game."""
+ return f"Game {item.display_name}"
+
+ def item_link(self, item: Game) -> str:
+ """Return the link to the game detail."""
+ return reverse("twitch:game_detail", args=[item.pk])
+
+
+class DropCampaignFeed(Feed):
+ """RSS feed for latest drop campaigns."""
+
+ title = "TTVDrops Drop Campaigns"
+ link = "/campaigns/"
+ description = "Latest drop campaigns on TTVDrops"
+
+ def items(self) -> list[DropCampaign]:
+ """Return the latest 100 drop campaigns."""
+ return list(DropCampaign.objects.order_by("-added_at")[:100])
+
+ def item_title(self, item: DropCampaign) -> str:
+ """Return the campaign name as the item title."""
+ return item.name
+
+ def item_description(self, item: DropCampaign) -> str:
+ """Return a description of the campaign."""
+ return item.description or f"Campaign {item.name}"
+
+ def item_link(self, item: DropCampaign) -> str:
+ """Return the link to the campaign detail."""
+ return reverse("twitch:campaign_detail", args=[item.pk])
diff --git a/twitch/urls.py b/twitch/urls.py
index 57dc6a6..b459ffc 100644
--- a/twitch/urls.py
+++ b/twitch/urls.py
@@ -3,6 +3,11 @@ from __future__ import annotations
from django.urls import path
from twitch import views
+from twitch.feeds import (
+ DropCampaignFeed,
+ GameFeed,
+ OrganizationFeed,
+)
app_name = "twitch"
@@ -18,4 +23,8 @@ urlpatterns = [
path("organizations/", views.OrgListView.as_view(), name="org_list"),
path("organizations/