Subscribing to a blog
This document describes a convention to subscribe to a blog written in HTML, without using a full-fledged syndication technology like Atom or RSS. It's a lightweight alternative to the hAtom microformat. This convention will obviously be less powerful than more advanced technologies such as Atom and will not work as well for other use-cases than maintaining a blog. Nothing prevents authors from simultaneously publishing an Atom feed if they wish. This convention can ease the generation of said feeds.
The remainder of this document describes how to interpret a single text/html document as if it were an Atom feed with all required elements present. This is to demonstrate how simple automatic generation of Atom feed is possible.
Feed elements
The URL from which the text/html document is fetched serves as the feed's "id" element and the recommended "link" element.
The contents of the first h1
tag in the page serves as the feed's required "title" element. Authors are encouraged to use titles which provide their own context, e.g. "m15o's blog" rather than "My blog".
A feed's required "updated" element should be set equal to the most recent value from all the associated entry's required "updated" elements. If no entries can be extracted from the document, then the feed is empty, and the feed's "updated" element should be set equal to the time the document was fetched.
Entry elements
A feed's entry elements are derived from a subset of the blog's li
tags, if any are present.
Each li
tag with a child time
tag followed by an a
tag represents a single entry. li
tags which do not meet this criteria are ignored.
An entry's required "title" element is equal to value of its a
tag.
An entry's required "id" element and "link" element with rel="alternate" are both equal to the href of the corresponding a
tag.
An entry's required "updated" element is noon UTC on the day indicated by the 10 character date stamp at the beginning of the corresponding h2
line's label.
Example
Here's an extract from this site's blog:
<h1>m15o's Blog</h1> <ul> <li><time>2022-07-12</time> <a href="html-journal-emacs.html">HTML Journal Emacs Mode</a> <li><time>2022-06-11</time> <a href="subscribing-to-a-journal-page.html">Subscribing to a journal page</a> </ul>
Credits
This spec has been heavily inspired by gmisub.