Post about Atom tombstones

This commit is contained in:
~lucidiot 2024-02-11 17:12:26 +01:00
parent 6b7d1bcc45
commit 58c4cbd2e0
1 changed files with 40 additions and 0 deletions

View File

@ -2269,6 +2269,46 @@ return <type id="{$i}" name="{$type}" count="{$count}" />
<p>So I can now say that I have walked onto a highway to write an XQuery script, while watching a cyclist pass by while shouting "The road is ours! The world belongs to us!" This is a very… interesting day.</p>
]]></description>
</item>
<item>
<title>Press F for deleted entries on Atom feeds</title>
<pubDate>Sun, 11 Feb 2024 17:11:12 +0100</pubDate>
<guid isPermaLink="false">tombstones</guid>
<category domain="https://envs.net/~lucidiot/rsrsss/">Tip</category>
<link>https://www.rfc-editor.org/rfc/rfc6721.html</link>
<description><![CDATA[
<p><a href="https://www.rfc-editor.org/rfc/rfc6721.html" target="_blank">RFC 6721</a>, <em>The Atom "deleted-entry" Element</em>, defines an XML namespace to mark some entries in an Atom feed as having been deleted. Deleting an entry from a feed usually makes no change for feedreaders, as they just assume that a feed only includes a portion of the articles and a deleted article just went over the size limit of the feed. This element is supposed to explicitly tell feedreaders to destroy this entry.</p>
<p>I particularly like the URL of this namespace.</p>
<figure>
<pre>&lt;feed
xmlns="http://www.w3.org/2005/Atom"
xmlns:at="http://purl.org/atompub/tombstones/1.0"
&gt;
&lt;at:deleted-entry
ref="tag:example.org,2032:/entries/1"
when="2032-09-11T12:46:00Z"
/&gt;
&lt;at:deleted-entry
ref="tag:example.org,2032:/entries/2"
when="2032-09-11T13:03:00Z"
&gt;
&lt;at:by&gt;
&lt;name&gt;Chuck Norris&lt;/name&gt;
&lt;email&gt;chucknorris@example.org&lt;/email&gt;
&lt;/at:by&gt;
&lt;at:comment&gt;Chuck Norris did not like this post.&lt;/at:comment&gt;
&lt;/at:deleted-entry&gt;
&lt;/feed&gt;</pre>
<figcaption>Example of deleted entries within an Atom feed</figcaption>
</figure>
<p>The specification includes various considerations on ensuring that the entry was indeed deleted by the feed's authors and not someone else, as well as supporting the aggregation of deleted entries from multiple feeds into one. It is also possible to have a separate XML file that only contains the <code>&lt;deleted-entry&gt;</code> tag, which would have a MIME type of <code>application/atomdeleted+xml</code>, with an extension of <code>.atomdeleted</code>. Do check out the RFC if you want to learn more.</p>
<p>Of course, this is totally unreliable, since any reader that does not support this namespace will ignore it completely, and some potentially evil readers might even highlight the entry as needing to become another example of the <a href="https://en.wikipedia.org/wiki/Streisand_effect" target="_blank">Streisand effect</a>. But in some applications, such as automated processing of Atom feeds for synchronizing some data, knowing for sure that something has been removed can be useful.</p>
<p>I searched for code that was referencing this namespace and found that a few YouTube Atom feed parsers do handle <code>deleted-entry</code> elements, so it might be possible that YouTube uses those tags. See <a href="https://github.com/suisei-cn/pystargazer/blob/4c677d0695c22e168477ca8ec94f5bb36a5a565b/pystargazer/plugins/youtube/__init__.py#L176" target="_blank">here</a> and <a href="https://github.com/lichess-org/lila/blob/9ffa9d8ff6da37a4a1356f48f3643b44f66e2c08/modules/streamer/src/main/YouTubeApi.scala#L71" target="_blank">here</a>.</p>
<p>Nothing stops you from adding <code>&lt;at:deleted-entry&gt;</code> elements to RSS feeds as well, just like how other Atom extensions can already be used there. But most feed readers will skip over this namespace in Atom feeds, so it is likely that almost nobody will support this on RSS feeds.</p>
<p>And if you were expecting actual tombstones from this namespace, well do know that <a href="https://www.eunicetoday.com/taxonomy/term/462/feed" target="_blank">RSS feeds for obituaries</a> are a thing. You're welcome.</p>
]]></description>
</item>
</channel>
<access:restriction relationship="allow" />
</rss>