A feed is a dynamic set of posts, typically listed in reverse-chronological order, often only the most recent n (like 10) of them. Homepage feeds usually contain all posts by the author, but many also choose to publish filtered feeds, for example posts of a particular type, or tagged with a particular tag.
Feeds, if correctly marked up, can be subscribed to, parsed and presented by readers.
Historically feeds have been served in separate feed files, in specialized XML formats like RSS or Atom, that are typically polled for updates by feed readers or aggregators. Feeds can also be (and are more and more often) served simply as HTML marked up with h-feed/h-entry, often on an existing page (e.g. homepage) thus not requiring a separate URL (and all the downsides thereof).
Many examples of feeds marked up with HTML+microformats can be found, e.g. on h-entry examples in the wild and h-feed indieweb examples. Add yourself below!
Aaron uses p3k to publish various feeds on aaronparecki.com, all marked up with h-entry and h-card:
- homepage feed containing all Aaron’s posts apart from responses and metrics
- Content-specific feeds, for example notes, articles and replies
- Tag-filtered feeds, for example #indieweb — note that this includes not only posts by Aaron but also posts tagged with #indieweb which he’s replied to
- A mentions feed, of every mention Aaron’s site has received
Barnaby uses Taproot publishes various feeds on waterpigs.co.uk, all marked up with h-feed, h-entry and h-card:
- homepage feed containing all Barnaby’s notes (including replies, checkins, photos), articles and tunes
- Content-specific feeds of notes, articles and music
- A (currently very ugly --Barnaby Walters 05:40, 16 March 2014 (PDT)) mentions feed of all the mentions waterpigs.co.uk has received
Tantek Çelik uses Falcon to publish h-feed with h-entry recent (20) items on tantek.com using Falcon. In addition he publishes a legacy Atom feed at tantek.com/updates.atom (reduced to only 3 most recent items as of 2013-09-29 due to Atom inefficiency).
The easiest way to mark up, publish and consume feeds is to use HTML+microformats2, specifically the
h-entry and h-feed vocabularies.
How to Publish
A simple feed can be marked up simply as a page with multiple h-entries on. The h-entries should be marked up in the same way they’re marked up on post permalink pages, although most people choose to leave comments/mentions out in feeds, instead showing comment/like/repost counts. For example:
<p class="p-author h-card">Barnaby Walters</p>
<div class="e-content">Good grief the weather here changes quickly. sun/hail/snow/sun/rain/snow/sun in 1hr</div>
<p><time class="dt-published">2014-03-12 12:00:16+00:00</time></p>
You can optionally also wrap the h-entries in an h-feed.
In addition, consider adding support for PuSH notifications to turn your feed into a real-time stream for PuSH subscribers.
How To Test
Shrewdness has a feed testing interface which you can use to test your feed pages:
How To Consume
With microformats2 h-entry, generic microformats2 parsers, you can get a JSON representation of any HTML page instead of relying on a separate XML feed.
Use the following algorithm to get feed posts and details for a page:
- Look for the first h-feed. If one is found:
- let the feed name be the name property of the h-feed
- let the default author of posts in the feed be the author property of the h-feed, if it exists
- let the posts in the feed be any h-entry children of the h-feed
- otherwise, let the name of the feed be the value of the
<title> of the page
- let the default author be the representative h-card found on the page
- let the posts in the feed be any h-entries found on the page
- to find earlier/later posts from the same feed, look for rel=prev[ious] and rel=next URLs, parse them in the same way
- Use the h-entry consumption algorithm to process each h-entry found in the feed
See also: microformats wiki section about Parsing h-feed.
There is a long history (since 1997) of the development of feeds, most of which has died to due the widespread abandonment of XML as a foundation of anything actually served on the web (largely replaced by HTML and JSON).
There is however still some inertial legacy XML support, some of which you may find sufficiently useful to implement — see backward compatibility.
XML feeds like RSS and Atom are known to be problematic for a variety of reasons, here are a few.
- DRY violation - feed/post content is typically already visible on HTML pages, thus the XML version is a (sometimes lower fidelity even) duplicate.
- RSS Date Formats blog documents the many hilarious ways people publish date-times in RSS/Atom feeds.
- Bad RSS link User Experience - visiting a link to an RSS or Atom feed results in seeing a pile of XML in the browser. There have been attempts to make the XML more presentable using XSLT and CSS, basically resulting in what looks like a web page
- Maintenance tax - added maintenance cost of separate code path for generating XML, coercing embedded content to be XML-friendly, validating, testing etc.
- Inefficient code to generate (perhaps because extra code to support them was hastily written due to being lower priority than visible HTML)
- Dated - not rich enough - "RSS and Atom are not rich enough to describe the kind of social web activities that we have today" — 
- Atom feed files many times larger than equivalent HTML - An Atom feed file is up to (maybe greater than) 4.5x the size of the equivalent HTML+microformats file.
- When the HTML is split into separate files for each post, that plus the index is still barely bigger than a single Atom file..
- When a single Atom file is compared to the equivalent single HTML file, whether for one post, or for many posts, in that one file, the Atom file is significantly bigger.
- For text notes, an Atom file is a multiple of the size of the equivalent HTML file.
- Consuming feed files is problematic and fragile. Consuming ATOM or RSS has been shown to be problematic and fragile — one of the creators of NewsGator documented 40+ common problems with feeds, most of which don’t happen when consuming visible HTML web pages (e.g. marked up with h-entry). Some of them still might, but in general most of them either don't, or are quickly automatically fixed because, well, people (including readers of a site) notice that visible HTML is broken and it typically gets fixed quite quickly.
All of the above should not obliterate the fact that RSS can be used a signal for new content and as a failover mechanism when microformats or other richer format is not available.
There are legacy systems, e.g. some feed readers, which only support older technologies such as XML-based feeds. For backward compatibility with those you may want to consider publishing the following:
- Atom ActivityStreams object-type annotations, e.g. inside entry elements:
<object-type xmlns="http://activitystrea.ms/spec/1.0/">http://activitystrea.ms/schema/1.0/note</object-type> or
<object-type xmlns="http://activitystrea.ms/spec/1.0/">http://activitystrea.ms/schema/1.0/article</object-type> for the note and article post types respectively.
- (any known live Atom ActivityStreams consumers?)
- How to set up your realtime feed - lots of helpful information related to setting up and testing an ATOM+ActivityStreams+PuSH feed
Documentation of when sites stop publishing and/or consuming legacy RSS/Atom feeds. See also site-deaths.
- 2013-08-14 Switching off HubMed's RSS and Atom feeds:
I've been considering stopping HubMed's feeds, and the demise of Google Reader seemed like a good incentive to do some spring cleaning. They were quite inefficient old scripts, which made the shared hosting provider unhappy, so today I decided to switch the feeds off. emphasis added.
- 2013-07-01 Yahoo! RSS Alerts shut down.
- 2013-06-30 Google Reader (RSS and Atom consumer) shut down.
- 2013-04-11 Evernote Removing RSS support for public notebooks:
We currently have support for RSS feeds for public notebooks to allow subscribers to automatically get updates to those notebooks. Last night's (4/10/2013) release of the web service removed this support. Attempts to access Public Notebook RSS feeds will return a 404 HTTP response code instead of the heretofore expected content. At this point, the feature was imposing excessive load on the service relative to its use and utility, and the decision was made to remove it.
Apple Safari Mail
- 2012 Apple quietly removes RSS support from OSX Mountain Lion's Safari and Mail