Add /discord/ feed
All checks were successful
Deploy to Server / deploy (push) Successful in 10s

This commit is contained in:
Joakim Hellsén 2026-03-14 02:50:40 +01:00
commit 4627d1cea0
Signed by: Joakim Hellsén
SSH key fingerprint: SHA256:/9h/CsExpFp+PRhsfA0xznFx2CGfTT5R/kpuFfUgEQk
16 changed files with 569 additions and 6 deletions

View file

@ -33,6 +33,10 @@
type="application/atom+xml"
title="All campaigns (Atom)"
href="{% url 'twitch:campaign_feed_atom' %}" />
<link rel="alternate"
type="application/atom+xml"
title="All campaigns (Discord)"
href="{% url 'twitch:campaign_feed_discord' %}" />
<link rel="alternate"
type="application/rss+xml"
title="Newly added games (RSS)"
@ -41,6 +45,10 @@
type="application/atom+xml"
title="Newly added games (Atom)"
href="{% url 'twitch:game_feed_atom' %}" />
<link rel="alternate"
type="application/atom+xml"
title="Newly added games (Discord)"
href="{% url 'twitch:game_feed_discord' %}" />
<link rel="alternate"
type="application/rss+xml"
title="Newly added organizations (RSS)"
@ -49,6 +57,10 @@
type="application/atom+xml"
title="Newly added organizations (Atom)"
href="{% url 'twitch:organization_feed_atom' %}" />
<link rel="alternate"
type="application/atom+xml"
title="Newly added organizations (Discord)"
href="{% url 'twitch:organization_feed_discord' %}" />
<link rel="alternate"
type="application/rss+xml"
title="Newly added reward campaigns (RSS)"
@ -57,6 +69,10 @@
type="application/atom+xml"
title="Newly added reward campaigns (Atom)"
href="{% url 'twitch:reward_campaign_feed_atom' %}" />
<link rel="alternate"
type="application/atom+xml"
title="Newly added reward campaigns (Discord)"
href="{% url 'twitch:reward_campaign_feed_discord' %}" />
{# Allow child templates to inject page-specific alternates into the head #}
{% block extra_head %}
{% endblock extra_head %}

View file

@ -14,6 +14,10 @@
type="application/atom+xml"
title="{{ campaign.game.display_name }} campaigns (Atom)"
href="{% url 'twitch:game_campaign_feed_atom' campaign.game.twitch_id %}" />
<link rel="alternate"
type="application/atom+xml"
title="{{ campaign.game.display_name }} campaigns (Discord)"
href="{% url 'twitch:game_campaign_feed_discord' campaign.game.twitch_id %}" />
{% endif %}
{% endblock extra_head %}
{% block content %}
@ -90,6 +94,8 @@
title="RSS feed for {{ campaign.game.display_name }} campaigns">[rss]</a>
<a href="{% url 'twitch:game_campaign_feed_atom' campaign.game.twitch_id %}"
title="Atom feed for {{ campaign.game.display_name }} campaigns">[atom]</a>
<a href="{% url 'twitch:game_campaign_feed_discord' campaign.game.twitch_id %}"
title="Discord feed for {{ campaign.game.display_name }} campaigns">[discord]</a>
{% endif %}
</div>
</div>

View file

@ -14,6 +14,10 @@
type="application/atom+xml"
title="All campaigns (Atom)"
href="{% url 'twitch:campaign_feed_atom' %}" />
<link rel="alternate"
type="application/atom+xml"
title="All campaigns (Discord)"
href="{% url 'twitch:campaign_feed_discord' %}" />
{% endblock extra_head %}
{% block content %}
<main>
@ -25,6 +29,8 @@
title="RSS feed for all campaigns">[rss]</a>
<a href="{% url 'twitch:campaign_feed_atom' %}"
title="Atom feed for all campaigns">[atom]</a>
<a href="{% url 'twitch:campaign_feed_discord' %}"
title="Discord feed for all campaigns">[discord]</a>
<a href="{% url 'twitch:export_campaigns_csv' %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}"
title="Export campaigns as CSV">[csv]</a>
<a href="{% url 'twitch:export_campaigns_json' %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}"

View file

@ -13,6 +13,10 @@
type="application/atom+xml"
title="All campaigns (Atom)"
href="{% url 'twitch:campaign_feed_atom' %}" />
<link rel="alternate"
type="application/atom+xml"
title="All campaigns (Discord)"
href="{% url 'twitch:campaign_feed_discord' %}" />
{% endblock extra_head %}
{% block content %}
<main>
@ -33,6 +37,8 @@
title="RSS feed for all campaigns">[rss]</a>
<a href="{% url 'twitch:campaign_feed_atom' %}"
title="Atom feed for campaigns">[atom]</a>
<a href="{% url 'twitch:campaign_feed_discord' %}"
title="Discord feed for campaigns">[discord]</a>
</div>
<hr />
{% if campaigns_by_game %}

View file

@ -8,9 +8,13 @@
<h1>RSS Feeds Documentation</h1>
<p>This page lists all available RSS feeds for TTVDrops.</p>
<p>
Note: Atom feeds are also available for the same resources under the
<code>/atom/</code> endpoints (links labeled "Atom" are shown next to RSS links).
Both RSS and Atom formats are supported and served in parallel for backward compatibility.
Atom feeds are also available for the same resources under the
<code>/atom/</code> endpoints.
</p>
<p>
Discord feeds are available under the <code>/discord/</code> endpoints. These are Atom feeds
that include Discord relative timestamps (e.g., <code>&lt;t:1773450272:R&gt;</code>) for dates,
making them ideal for Discord bots and integrations.
</p>
<section>
<h2>Global RSS Feeds</h2>
@ -26,12 +30,20 @@
&nbsp;|&nbsp;
<a href="{{ feed.atom_url }}">Subscribe to {{ feed.title }} Atom Feed</a>
{% endif %}
{% if feed.discord_url %}
&nbsp;|&nbsp;
<a href="{{ feed.discord_url }}">Subscribe to {{ feed.title }} Discord Feed</a>
{% endif %}
</p>
<pre><code class="language-xml">{% if feed.example_xml %}{{ feed.example_xml|escape }}{% else %}No example XML available yet.{% endif %}</code></pre>
{% if feed.example_xml_atom %}
<h4>Atom example</h4>
<pre><code class="language-xml">{{ feed.example_xml_atom|escape }}</code></pre>
{% endif %}
{% if feed.example_xml_discord %}
<h4>Discord example</h4>
<pre><code class="language-xml">{{ feed.example_xml_discord|escape }}</code></pre>
{% endif %}
</li>
{% endfor %}
</ul>
@ -49,6 +61,7 @@
<p>
Endpoint: <code>{{ feed.url }}</code>
{% if feed.atom_url %}&nbsp;|&nbsp; Atom: <code>{{ feed.atom_url }}</code>{% endif %}
{% if feed.discord_url %}&nbsp;|&nbsp; Discord: <code>{{ feed.discord_url }}</code>{% endif %}
</p>
{% if feed.has_sample %}
<p>
@ -57,6 +70,10 @@
&nbsp;|&nbsp;
<a href="{{ feed.atom_url }}">View Atom example</a>
{% endif %}
{% if feed.discord_url %}
&nbsp;|&nbsp;
<a href="{{ feed.discord_url }}">View Discord example</a>
{% endif %}
</p>
{% endif %}
<pre><code class="language-xml">{% if feed.example_xml %}{{ feed.example_xml|escape }}{% else %}No example XML available yet.{% endif %}</code></pre>
@ -64,6 +81,10 @@
<h4>Atom example</h4>
<pre><code class="language-xml">{{ feed.example_xml_atom|escape }}</code></pre>
{% endif %}
{% if feed.example_xml_discord %}
<h4>Discord example</h4>
<pre><code class="language-xml">{{ feed.example_xml_discord|escape }}</code></pre>
{% endif %}
</li>
{% endfor %}
</ul>

View file

@ -13,6 +13,10 @@
type="application/atom+xml"
title="{{ game.display_name }} campaigns (Atom)"
href="{% url 'twitch:game_campaign_feed_atom' game.twitch_id %}" />
<link rel="alternate"
type="application/atom+xml"
title="{{ game.display_name }} campaigns (Discord)"
href="{% url 'twitch:game_campaign_feed_discord' game.twitch_id %}" />
{% endif %}
{% endblock extra_head %}
{% block content %}
@ -49,6 +53,8 @@
title="RSS feed for {{ game.display_name }} campaigns">[rss]</a>
<a href="{% url 'twitch:game_campaign_feed_atom' game.twitch_id %}"
title="Atom feed for {{ game.display_name }} campaigns">[atom]</a>
<a href="{% url 'twitch:game_campaign_feed_discord' game.twitch_id %}"
title="Discord feed for {{ game.display_name }} campaigns">[discord]</a>
</div>
</div>
</div>

View file

@ -12,6 +12,10 @@
type="application/atom+xml"
title="Newly added games (Atom)"
href="{% url 'twitch:game_feed_atom' %}" />
<link rel="alternate"
type="application/atom+xml"
title="Newly added games (Discord)"
href="{% url 'twitch:game_feed_discord' %}" />
{% endblock extra_head %}
{% block content %}
<main>
@ -22,6 +26,8 @@
<a href="{% url 'twitch:game_feed' %}" title="RSS feed for all games">[rss]</a>
<a href="{% url 'twitch:game_feed_atom' %}"
title="Atom feed for all games">[atom]</a>
<a href="{% url 'twitch:game_feed_discord' %}"
title="Discord feed for all games">[discord]</a>
<a href="{% url 'twitch:export_games_csv' %}"
title="Export all games as CSV">[csv]</a>
<a href="{% url 'twitch:export_games_json' %}"

View file

@ -11,6 +11,10 @@
type="application/atom+xml"
title="Newly added games (Atom)"
href="{% url 'twitch:game_feed_atom' %}" />
<link rel="alternate"
type="application/atom+xml"
title="Newly added games (Discord)"
href="{% url 'twitch:game_feed_discord' %}" />
{% endblock extra_head %}
{% block content %}
<main>
@ -20,6 +24,8 @@
<a href="{% url 'twitch:game_feed' %}" title="RSS feed for all games">[rss]</a>
<a href="{% url 'twitch:game_feed_atom' %}"
title="Atom feed for all games">[atom]</a>
<a href="{% url 'twitch:game_feed_discord' %}"
title="Discord feed for all games">[discord]</a>
<a href="{% url 'twitch:export_games_csv' %}"
title="Export all games as CSV">[csv]</a>
<a href="{% url 'twitch:export_games_json' %}"

View file

@ -9,6 +9,8 @@
title="RSS feed for all organizations">[rss]</a>
<a href="{% url 'twitch:organization_feed_atom' %}"
title="Atom feed for all organizations">[atom]</a>
<a href="{% url 'twitch:organization_feed_discord' %}"
title="Discord feed for all organizations">[discord]</a>
<a href="{% url 'twitch:export_organizations_csv' %}"
title="Export all organizations as CSV">[csv]</a>
<a href="{% url 'twitch:export_organizations_json' %}"

View file

@ -13,6 +13,10 @@
type="application/atom+xml"
title="{{ game.display_name|default:game.name|default:game.twitch_id }} campaigns (Atom)"
href="{% url 'twitch:game_campaign_feed_atom' game.twitch_id %}" />
<link rel="alternate"
type="application/atom+xml"
title="{{ game.display_name|default:game.name|default:game.twitch_id }} campaigns (Discord)"
href="{% url 'twitch:game_campaign_feed_discord' game.twitch_id %}" />
{% endfor %}
{% endif %}
{% endblock extra_head %}

View file

@ -13,6 +13,10 @@
type="application/atom+xml"
title="Reward campaigns (Atom)"
href="{% url 'twitch:reward_campaign_feed_atom' %}" />
<link rel="alternate"
type="application/atom+xml"
title="Reward campaigns (Discord)"
href="{% url 'twitch:reward_campaign_feed_discord' %}" />
{% endblock extra_head %}
{% block content %}
<!-- Campaign Title -->
@ -36,6 +40,8 @@
title="RSS feed for all reward campaigns">RSS feed for all reward campaigns</a>
<a href="{% url 'twitch:reward_campaign_feed_atom' %}"
title="Atom feed for all reward campaigns">[atom]</a>
<a href="{% url 'twitch:reward_campaign_feed_discord' %}"
title="Discord feed for all reward campaigns">[discord]</a>
</div>
<!-- Campaign Summary -->
{% if reward_campaign.summary %}<p id="campaign-summary">{{ reward_campaign.summary|linebreaksbr }}</p>{% endif %}

View file

@ -12,6 +12,10 @@
type="application/atom+xml"
title="Reward campaigns (Atom)"
href="{% url 'twitch:reward_campaign_feed_atom' %}" />
<link rel="alternate"
type="application/atom+xml"
title="Reward campaigns (Discord)"
href="{% url 'twitch:reward_campaign_feed_discord' %}" />
{% endblock extra_head %}
{% block content %}
<h1>Reward Campaigns</h1>
@ -21,6 +25,8 @@
title="RSS feed for all reward campaigns">[rss]</a>
<a href="{% url 'twitch:reward_campaign_feed_atom' %}"
title="Atom feed for all reward campaigns">[atom]</a>
<a href="{% url 'twitch:reward_campaign_feed_discord' %}"
title="Discord feed for all reward campaigns">[discord]</a>
</div>
<p>This is an archive of old Twitch reward campaigns because we do not monitor them.</p>
<p>