XML RSS
RSS (Really Simple Syndication) is an XML format for publishing a list of updates — blog posts, news headlines, podcast episodes. A site publishes a feed file such as feed.xml; feed readers and podcast apps check it regularly and show subscribers what's new. No account, algorithm or email address required.
A minimal RSS 2.0 feed
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>Allotment Diaries</title>
<link>https://allotment.example.com/</link>
<description>Notes from a small vegetable garden</description>
<language>en-gb</language>
<item>
<title>First tomatoes of the season</title>
<link>https://allotment.example.com/posts/first-tomatoes</link>
<description>Three weeks late, but worth the wait.</description>
<pubDate>Sat, 12 Jul 2026 08:30:00 GMT</pubDate>
<guid>https://allotment.example.com/posts/first-tomatoes</guid>
</item>
<item>
<title>Building a compost bay from pallets</title>
<link>https://allotment.example.com/posts/compost-bay</link>
<description>Four pallets, twelve screws and an afternoon.</description>
<pubDate>Sun, 29 Jun 2026 17:05:00 GMT</pubDate>
<guid>https://allotment.example.com/posts/compost-bay</guid>
</item>
</channel>
</rss>Structure
rss (version="2.0")
└── channel ← the feed itself
├── title, link, description (required)
├── language, image, lastBuildDate … (optional)
└── item (repeated) ← one entry each
├── title, link, description
├── pubDate, guid
└── enclosure, category, author … (optional)| Channel element | Required | Meaning |
|---|---|---|
<title> |
yes | Name of the feed |
<link> |
yes | The website the feed belongs to |
<description> |
yes | One-sentence summary |
<language> |
no | Language code like en-gb |
<lastBuildDate> |
no | When the feed last changed |
<image> |
no | Logo (with url, title, link) |
| Item element | Meaning |
|---|---|
<title> / <description> |
Headline and summary (at least one of them is required) |
<link> |
URL of the full article |
<pubDate> |
Publication date in RFC 822 format: Sat, 12 Jul 2026 08:30:00 GMT |
<guid> |
A unique, permanent id — readers use it to detect new items |
<category> |
A tag; may repeat |
<enclosure url="…" length="…" type="audio/mpeg"/> |
An attached file — this is how podcasts work |
Reading a feed with JavaScript
A feed is just XML, so DOMParser and a few querySelector calls turn it into a news list:
<!DOCTYPE html>
<html>
<head>
<style>
body { font-family: system-ui, sans-serif; }
article { border-bottom: 1px solid #ddd; padding: 6px 0; }
time { color: #777; font-size: .85em; }
</style>
</head>
<body>
<h3 id="feedTitle"></h3>
<div id="items"></div>
<script>
const feedXml = `<rss version="2.0"><channel>
<title>Allotment Diaries</title>
<link>https://allotment.example.com/</link>
<description>Notes from a small vegetable garden</description>
<item><title>Building a compost bay from pallets</title><link>https://allotment.example.com/posts/compost-bay</link>
<pubDate>Sun, 29 Jun 2026 17:05:00 GMT</pubDate></item>
<item><title>First tomatoes of the season</title><link>https://allotment.example.com/posts/first-tomatoes</link>
<pubDate>Sat, 12 Jul 2026 08:30:00 GMT</pubDate></item>
<item><title>Slugs: a ceasefire</title><link>https://allotment.example.com/posts/slugs</link>
<pubDate>Tue, 03 Jun 2026 19:45:00 GMT</pubDate></item>
</channel></rss>`;
const doc = new DOMParser().parseFromString(feedXml, 'application/xml');
document.getElementById('feedTitle').textContent = doc.querySelector('channel > title').textContent;
const items = [...doc.querySelectorAll('item')].map(it => ({
title: it.querySelector('title').textContent,
link: it.querySelector('link').textContent,
date: new Date(it.querySelector('pubDate').textContent),
})).sort((a, b) => b.date - a.date); // newest first
for (const it of items) {
const art = document.createElement('article');
const a = document.createElement('a');
a.href = it.link; a.textContent = it.title; a.target = '_blank';
const t = document.createElement('time');
t.textContent = ' ' + it.date.toISOString().slice(0, 10);
art.append(a, t);
document.getElementById('items').append(art);
}
console.log(items.map(i => i.date.toISOString().slice(0, 10) + ' ' + i.title).join('\n'));
</script>
</body>
</html>Note: On a real site you'd
fetch('/feed.xml')first. Feeds on other domains usually can't be fetched from browser JavaScript because of CORS — feed readers run on servers or as apps for this reason.
Podcasts are RSS
A podcast feed is an RSS feed whose items carry an <enclosure> pointing to the audio file. Apple and others add extra elements in their own namespace:
<rss version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
<channel>
<title>Byte-Sized History</title>
<link>https://podcast.example.com/</link>
<description>Ten-minute stories from computing history</description>
<itunes:author>R. Nakamura</itunes:author>
<item>
<title>Ep. 12 — The first computer bug</title>
<enclosure url="https://podcast.example.com/ep12.mp3" length="9876543" type="audio/mpeg"/>
<guid isPermaLink="false">bsh-ep12</guid>
<pubDate>Mon, 07 Sep 2026 06:00:00 GMT</pubDate>
<itunes:duration>00:10:42</itunes:duration>
</item>
</channel>
</rss>Advertising your feed
Add a <link> in your HTML <head> so browsers and readers can discover the feed automatically:
<link rel="alternate" type="application/rss+xml" title="Allotment Diaries" href="/feed.xml">RSS vs Atom
Atom is a newer, more strictly specified feed format (<feed xmlns="http://www.w3.org/2005/Atom"> with <entry> elements). Feed readers support both. RSS 2.0 remains the most common, especially for podcasts.
Test yourself
Which element contains the individual entries of an RSS feed?
<entry><item><post><article>
What makes an RSS feed a podcast feed?
- The
podcast="true"attribute - Items with an
<enclosure>pointing to an audio file - A
.mp3file extension on the feed - Using Atom instead of RSS
What is <guid> used for?
- The author's name
- A permanent unique id so readers can tell which items are new
- The category
- The feed's language