Benjamin Lu

everyday is cool

Writing a Small RSS Feed

An RSS feed lets a reader check a site for new entries without opening its homepage. A small feed can start with just a title, a site link, a description, and one item.

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>My Web Notes</title>
    <link>https://example.com/</link>
    <description>Notes about building websites</description>
    <item>
      <title>A new stylesheet</title>
      <link>https://example.com/new-stylesheet.html</link>
      <description>Trying a shared stylesheet.</description>
    </item>
  </channel>
</rss>

Save the example as feed.xml and open it locally to check that it parses. If you publish your own copy, replace the example links with real addresses and subscribe to the feed in a reader. Add a second item and refresh the subscription to see how a new entry appears. Remember to write a literal ampersand in XML text as &amp;.

RSS 2.0 specification