feeds

illustration of a newsboy from The Sun hawking a copy containing

Notes on various feeds

rss

RSS is an XML-based syndication format commonly used by blogs and podcasts.

<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
  <title>avanier's journal</title>
  <link>https://avanier.dev/journal</link>
  <description>journal</description>
  <generator>arachne</generator>
  <lastBuildDate>Tue, 26 Nov 2024 07:16:42 GMT</lastBuildDate>
  <item>
    <title>oasis</title>
    <link>https://avanier.dev/oasis</link>
    <description>distancing from search engines</description>
    <pubDate>Thu, 14 Nov 2024 13:21:13 GMT</pubDate>
    <guid>https://avanier.dev/oasis</guid>
  </item>
</channel>

Linking to an RSS feed:

<!-- add to head -->
<link rel="alternate" type="application/rss+xml" title="avanier's journal (rss)" href="journal.xml">
<a href="journal.xml" rel="alternate" type="application/rss+xml">feed</a>

atom

Atom is another XML-based syndication feed format

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <generator>arachne</generator>
  <title>avanier's journal</title>
  <link rel="self" href="https://avanier.dev/journal.atom"/>
  <link rel="alternate" href="https://avanier.dev" type="text/html"/>
  <updated>2024-11-14T13:21:13.930Z</updated>
  <id>https://avanier.dev/journal</id>
  <author>
    <name>Josh Avanier</name>
    <uri>https://avanier.dev/josh</uri>
  </author>
  <entry>
    <title>oasis</title>
    <id>https://avanier.dev/oasis</id>
    <link rel="alternate" href="https://avanier.dev/oasis" type="text/html"/>
    <updated>2024-11-14T13:21:13.930Z</updated>
    <summary>distancing from search engines</summary>
  </entry>
</feed>

Linking to an Atom feed:

<!-- add to head -->
<link rel="alternate" type="application/atom+xml" title="avanier's journal (atom)" href="journal.atom">
<a href="journal.atom" rel="alternate" type="application/atom+xml">feed</a>

guidelines

  • Timestamps use RFC 3339*
entry elements
idmandatory
titlemandatory
updatedmandatory, last modified timestamp
authormultiple authors are allowed; optional if there’s an author element in <feed>
contentrequired if there’s no alternate link or summary
summaryentry summary or excerpt
categoryoptional, multiple categories are allowed
contributoroptional, multiple contributors are allowed
publishedoptional, published date
rightsoptional, copyright info

json feed

A JSON Feed is a syndication format, similar to Atom and RSS, just using JSON.

{
  "version":1.1,
  "title":"avanier's journal",
  "home_page_url":"https://avanier.dev/journal",
  "feed_url":"https://avanier.dev/journal.json",
  "authors":[{"name":"Josh Avanier","url":"https://avanier.dev/josh"}],
  "language":"en",
  "items":[
    {
      "id":"https://avanier.dev/oasis",
      "url":"https://avanier.dev/oasis",
      "title":"oasis",
      "content_text":"distancing from search engines",
      "date_published":"2024-11-14T13:21:13.930Z",
      "date_modified":"2024-11-14T13:21:13.930Z"
    }
  ]
}

Linking to a JSON feed:

<!-- add to head -->
<link rel="alternate" type="application/json" title="avanier's journal (jsonfeed)" href="journal.json">
<a href="journal.json" rel="alternate" type="application/json">feed</a>

twtxt

twtxt is a text file that contains status updates of a single user.

  • The file should contain one status per line
  • Each line is an RFC 3339 date-time string and the status, separated by a tab character
  • The file needs to be UTF-8 encoded and use LF line separators
  • Limit statuses to 140 characters

You can use the Python client but I just use a small script to update twtxt:

#!/usr/bin/env sh
printf "%s\t%s\n" "$(date -Is)" "$1" | tee -a ~/tw.txt

openstories

OpenStories is a syndication format for distributing Instagram-like stories. To add it to your site, you just need a JSON feed and the <open-stories> custom element. You can see an example in the Gallery. Not viable for the JS-averse.

tools

I currently use Newsboat to check feeds in terminal. Vivaldi also has a nice way of viewing feeds.

resources

Read more details about the formats here: