This zone is sleeping right now! ZzzZZzzz

Better not disturb it! ~You go to the petrol station and buy a slushy instead, everything is cool!~

This area will open again in 000.beats!

(Learn about Swatch Time)

Some other zones are awake :^]


Artifacts Gallery Guilds Search Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining?
a Summer day - @559.97
Activity rating: Three Stars Posts & Arts: 34/1k.beats Random | Recent Posts | Guild Recents
News: :happy: Open the all windows! Your mind needs storms and air! :happy: Guild Events: Summer Projects

+  MelonLand Forum
|-+  Materials & Info
| |-+  ♺ ∙ Web Crafting Materials
| | |-+  Let's make a (basic, minimal) RSS feed!


« previous next »
Pages: [1] Print Embed
Author Topic: Let's make a (basic, minimal) RSS feed!  (Read 300 times)
Dan Q
Hero Member ⚓︎
*****
View Profile WWWArt


I have no idea what I am doing
⛺︎ My Room
RSS: RSS

Guild Memberships:
Artifacts:
Dan Q Cruisin'I DIDN'T meet Dan Q on Melonland!Visited on Melon's 10th Anniversary!
« on: a Summer day » Embed

I've seen a lot of confusion over RSS feeds and how to make one. Let's have a go at making a simple one together.

(By the way: I'll be using the term "RSS feed" to refer to all technologies for web feeds, but there are really two major standards: RSS and Atom. You can use either; they're both widely supported. Or both! This guide will use RSS.)

What is an RSS feed?

An RSS feed is a web address that provides a list of "items", usually ordered by date, in a format designed to be read by machines. Each "item" in the feed might have a title, description, link, and/or attached metadata. They're really useful for:

- Blogs: each "item" can be (or point to) a blog post
- News: each "item" can be (or point to) a news article
- Site updates: each "item" can describe the changes you made today
- Podcasts: each "item" links to an MP3 file (this is how podcasts actually work!)

(Fun fact: did you know that every YouTube channel has an RSS feed too: it's a much better way to follow YouTube channels than using the site's built-in "subscribe" feature which (a) puts you at the mercy of their algorithm, (b) gives information about your interests to Google, and (c) makes it hard to "save" a video for later while continuing through a series, and remembering where you were up to.)

RSS feeds are super useful because people can subscribe to them using a feed reader. A feed reader downloads the RSS feeds you subscribe to on a schedule you choose. For example:

- I visit @PossiblyAxolotl's blog and go "that's really cool; I want to know when they write more!"
- I tell my feed reader (I use FreshRSS, but there are lots of other choices) to subscribe to that site
- Now, my feed reader checks the blog's RSS feed about 4 times a day, and - if there's a new post - it appears in my feed reader alongside all the other people who I follow!

Let's make an RSS feed!

Personally, I think the best way to make an RSS feed is... to have a computer make one for you. You can do this, for example, by using a static site generator or a CMS that will take your posts, turn them into a set of HTML pages, and also make an RSS feed that links to all those pages.

But today, we're going to keep things simple and do it by hand.

For the sake of example, I've made a quick Neocities site at rss-demo.neocities.org. If you visit it, you'll see that it's a blog with two (boring) posts:

- First Post! was published 1 July at https://rss-demo.neocities.org/post1
- Is this thing on? was published 7 July at https://rss-demo.neocities.org/post2

Let's make an RSS feed to describe those two posts (and any future ones that I choose to add!), so that people can subscribe to my new blog.

Step 1: making the XML feed

I've used the Neocities editor to make a new file called feed.xml. You can make it your own way (e.g. maybe you use a text editor on your own computer and upload later). You can call the file anything you like, but giving it a .xml extension helps ensure that your server understands what kind of file it is and doesn't send confusing messages to people's computers!

Here's my new file. I'll talk you though what each bit means in a moment:


Code
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>

  <title>My Demo Blog</title>
  <description>My demo blog; not terribly exciting!</description>
  <link>https://rss-demo.neocities.org/</link>
  <atom:link href="https://rss-demo.neocities.org/feed.xml" rel="self" type="application/rss+xml" />

  <item>
    <title>Is this thing on?</title>
    <description>More blogging, plus I made my RSS feed work!</description>
    <link>https://rss-demo.neocities.org/post2</link>
    <guid>https://rss-demo.neocities.org/post2</guid>
    <pubDate>Tue, 7 Jul 2026 12:00:00 +0000</pubDate>
  </item>

  <item>
    <title>First post!</title>
    <description>I started a blog.</description>
    <link>https://rss-demo.neocities.org/post1</link>
    <guid>https://rss-demo.neocities.org/post1</guid>
    <pubDate>Wed, 1 Jul 2026 12:00:00 +0000</pubDate>
  </item>

</channel>
</rss>

This is what I'd consider a pretty "minimal" RSS file... but in fact I've added a few "optional" things: it'd be possible to cut it down even more and still have it work. Anyway: it consists of the following:

<?xml version="1.0" encoding="UTF-8" ?>

This just says "I'm an XML file."

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">

This says two things:

1. I'm an RSS file (that's the kind of XML file I am!), using RSS version 2.0 (the latest version), and
2. I also use bits of the Atom standard (there's one particular bit of Atom that's super-useful, which we'll come to in a moment)

<channel> ... </channel>

Every RSS feed contains exactly one <channel>, wrapped around everything else. Think of it like the <html> of a HTML page: it's where everything else goes inside!

<title>My Demo Blog</title>
<description>My demo blog; not terribly exciting!</description>
<link>https://rss-demo.neocities.org/</link>


You must put a <title>, <description>, and <link> in your <channel>. The title can be the title of your site, or of your blog, or whatever. The description can be a one-liner to say what it is. The <link> should point at the web page that is the root of what the feed represents. So if your feed represents your whole site, put your site URL! If it represents just the stuff in the /blog/ folder, link to the homepage of the blog section.

Getting any of these "wrong" isn't a catastrophe. Just go back and change them later. But they need to be present!

<atom:link href="https://rss-demo.neocities.org/feed.xml" rel="self" type="application/rss+xml" />

This bit's optional, but recommended. We use the Atom standard to add a "link to ourself" in the RSS feed. That is: a link back to where the RSS feed can be found. Having this means that even if somebody downloads and saves the RSS feed somewhere, and "loses" where they found it, they can just look it up.

<item> ... </item>

A <channel> can contain any number of <items>: the "things" you want subscribers to know about. New subscribers will probably get everything listed (depending on their feed reader's settings), but their feed reader might make it easy to say e.g. "throw away everything over a month old" if they want. But once subscribed... every time you add a new <item>... they'll hear about it!


<title>First post!</title>
<description>I started a blog.</description>


Each <item> must have a <title>, or a <description>, or both. Everything else is optional.

Here I'm using the title of the blog post as the <title>, and I'm putting a summary of what it's about in the <description>.

It's possible to put the full HTML text of the post in the description (and people who love RSS will thank you for it), but you have to do this really carefully! If you choose to do this, you need a CDATA block to prevent the embedded HTML from making the XML invalid! To begin with, I'd recommend against putting full contents in the <description>. When you're ready to do to, see example 2 on this page (and be sure to carefully count the number of square brackets you need!).

<link>https://rss-demo.neocities.org/post1</link>

Optional but recommended, a <link> points to "where on the site can I see the HTML version of this <item>". That's probably the URL of a blog post, for example!

<guid>https://rss-demo.neocities.org/post1</guid>

Optional but recommended. A <guid> can be used by feed readers to detect if they're getting "duplicate" content, which can happen if e.g. RSS feeds get combined, or syndicated, or a particular item appears in multiple feeds. The easiest way to use these is just to give them the same value as your <link>! Alternatively, anything that's probably globally-unique is fine, e.g. the domain name for your site, then a space, then the date and time you wrote this item, perhaps.

<pubDate>Wed, 1 Jul 2026 12:00:00 +0000</pubDate>

Optional but recommended. T <pubDate> says "when was this <item> published?". It can be used by feed readers to "order" things, especially episodic content (like blog posts)!

If you add a <pubDate>, take care to follow the format exactly: some feed readers are really picky!

The date should be in the (horrible) RFC822 format; that is: (a) optional three-letter English day of week, followed by comma and space, (c) 1-2 digit day of month, (d) space, (e) three-letter English month name, (f) space, (g) four-digit year number, (h) space, (i) hours, minutes, seconds (seconds is optional), separated by colons, (j) space, (k) timezone as a + or - sign, two digit hours, two digit minutes, compared to UTC (OR one of several US-centric timezone codes). (You can just use +0000; nobody cares.)

Step 2: check your XML feed

The W3C operate a feed validator at https://validator.w3.org/feed/. Give it your feed URL and it'll tell you whether it's valid. Look, mine is!

(There's an alternative validator at https://www.rssboard.org/rss-validator/.)

If you test the same address multiple times (while debugging), watch out for caching! If you're making changes but they're not showing-up in the validator, consider "tweaking" the URL in a way that doesn't break it (e.g. test the same URL but with "?test1", "?test2" or similar on the end!): just remember this will invalidate your atom self-link! Or use "validate by direct input" mode and copy-paste your feed contents in!

If you want to simulate what your feed might look like in a real reader, the validators at https://rssvalidator.app/ and https://www.freecodeformat.com/rss-viewer.php will kind-of simulate that!

Step 3: share your feed URL

Now it's time to encourage your readers to subscribe to your feed!

Put a link to it on your homepage! That's a good start. But to get a gold star, add it to your site metadata too! Put this in the <head> section of your page (or even: every page of your site!) -


Code
<link href="/feed.xml" rel="alternate" title="RSS Feed for My Demo Blog" type="application/rss+xml">

Replace /feed.xml with the URL (relative or absolute) of your RSS feed, and the title with whatever you want to call it. Now, clever feed reader software can find your RSS feed... directly from the page! Some web browsers/plugins will automatically detect the feed and show "subscribe" buttons that connect directly to the feed reader! It's magical!

You can test that your <link...> tag is working using RSSBoard's validator. E.g. if you put "https://rss-demo.neocities.org/" into that validator, you'll see how they automatically find the URL of the RSS feed... because of that <link> tag. Feed readers can do this too.

Step 4? - use a feed reader yourself!

If you don't use a feed reader already... you should start!

If/when you do: consider subscribing to your own feed. This helps act as a canary to show you when there are problems. If you're writing an RSS feed by hand, like this, then introducing a problem is surprisingly easy, and it's nice to know if you did!

But if you want a real safe approach, try a free service like Feed Canary which will automatically email you if your RSS feed breaks (badly). That tool's saved my bacon at least once; I recommend it!

Logged

https://danq.me/_q26t/badges/dan-q-88x31-lighter.gif https://danq.me/_q26t/badges/dan-q-88x31-peekaboo-scroller.gif https://beige-buttons.danq.dev/beige-buttons-88x31.gif https://embed-html.danq.dev/embed-html-88x31.gif

Artifact Swap: PolyamorousI met Dan Q on Melonland!Doctor RedactedJoined 2025!
candycanearter07
Hero Member ⚓︎
*****
View Profile WWWArt


i like slimes
⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: candycanearter
Itch.io: My Games
RSS: RSS

Guild Memberships:
Artifacts:
Visited on Melon's 10th Anniversary!it's tbhchansey!Goomy, I Choose You!uh oh! a pigeon got in!Artsy Candy Cane
« Reply #1 on: a Summer day » Embed

Very useful! I didn't know about the header trick for linking a feed, I'm going to put that in my site rework.

Logged

new to oldnet be nice
https://status.cafe/users/candycanearter/badge.png https://abslimeware.neocities.org/assets/images/blinkers/penguins.gif

https://abslimeware.neocities.org/assets/images/blinkers/slimebounce.gif https://card.exophase.com/2/0/268504.png?1727352149

https://i.imgur.com/S1cx8ZZ.pnghttps://i.imgur.com/7ntZZGM.pnghttps://i.imgur.com/xKIpW2A.pnghttps://i.imgur.com/YMPbu9R.png

Artifact Swap: buzzystickerSave the saveshoeBlob Creaturecards all the way downCommon Slorg
ValyceNegative
Sr. Member ⚓︎
****
View Profile WWW


Your Average Toony Wolf!
⛺︎ My Room

Guild Memberships:
Artifacts:
Visited on Melon's 10th Anniversary!Game MachineGrass MailViolet Ribbon of WelcomeJoined 2024!
« Reply #2 on: a Summer day » Embed

I thank you so much for this guide! My previous RSS file I made following another guide kept breaking up and could not get validated by W3C. There was indeed a lot of stuff that was unneded but I had no idea if it was mandatory or not so I kept it even though I couldn't exactly understand what they wanted from me, haha!
Time to get dat valid RSS badgggggee :v

Logged

https://valycenegative.neocities.org/img/VN8831A.png

https://valycenegative.neocities.org/img/BNRDragonite.gif https://valycenegative.neocities.org/img/BNRTaurus.gif https://valycenegative.neocities.org/img/BNR90s.gif https://valycenegative.neocities.org/img/BNRGranny.gif https://valycenegative.neocities.org/img/BNRGBC.gif

Artifact Swap: Green Spiffo
Limette
Jr. Member ⚓︎
**
View Profile WWWArt


⛺︎ My Room

Guild Memberships:
Artifacts:
Visited on Melon's 10th Anniversary!I got robbed by Dan Q on Melonland!Joined 2025!
« Reply #3 on: a Summer day » Embed

Are you a mind reader?? This is the second time I thought "Man, I should learn how to do X so I can put it on my site," only for me to then stumble across a Dan Q tutorial about the exact thing I was buried in research over a few days ago. First it was the HTML/CSS gallery grid, now its RSS feeds... which I wanted to learn about so I could add one to said gallery. I'm amazed, and mildly spooked.

I'll get back to this whenever I find the time to actually make a feed for my site.

Logged

https://limette.neocities.org/assets/limette.gifhttps://file.garden/aJDdYDydqnG0q1NR/blinkies/exinc.gif
Dan Q
Hero Member ⚓︎
*****
View Profile WWWArt


I have no idea what I am doing
⛺︎ My Room
RSS: RSS

Guild Memberships:
Artifacts:
Dan Q Cruisin'I DIDN'T meet Dan Q on Melonland!Visited on Melon's 10th Anniversary!
« Reply #4 on: a Summer day » Embed

Are you a mind reader??

My partner thinks so.

One year there a was a new film we were both excited to see, having been following the franchise for some time. She accidentally saw a spoiler in a newspaper, implying the death of some established character or other, and she said to me: "I accidentally read a spoiler; but don't worry, I'm not going to give anything away." And by the tone of voice she used alone, I knew who died and told her so.

I don't know if I'm unusually perceptive or she's easy to read, but at least one of those must be true.

Logged

https://danq.me/_q26t/badges/dan-q-88x31-lighter.gif https://danq.me/_q26t/badges/dan-q-88x31-peekaboo-scroller.gif https://beige-buttons.danq.dev/beige-buttons-88x31.gif https://embed-html.danq.dev/embed-html-88x31.gif

Artifact Swap: PolyamorousI met Dan Q on Melonland!Doctor RedactedJoined 2025!
ValyceNegative
Sr. Member ⚓︎
****
View Profile WWW


Your Average Toony Wolf!
⛺︎ My Room

Guild Memberships:
Artifacts:
Visited on Melon's 10th Anniversary!Game MachineGrass MailViolet Ribbon of WelcomeJoined 2024!
« Reply #5 on: a Summer day » Embed

@Dan Q I have a question!
When adding new items to our feed, shall we write the new ones at the top or at the bottom? I imagine most readers order the items by looking at the pubdate, but what happens when that's not present? Does the order change based on the reader, or does it follow the usual "latest news on top"?

Logged

https://valycenegative.neocities.org/img/VN8831A.png

https://valycenegative.neocities.org/img/BNRDragonite.gif https://valycenegative.neocities.org/img/BNRTaurus.gif https://valycenegative.neocities.org/img/BNR90s.gif https://valycenegative.neocities.org/img/BNRGranny.gif https://valycenegative.neocities.org/img/BNRGBC.gif

Artifact Swap: Green Spiffo
Dan Q
Hero Member ⚓︎
*****
View Profile WWWArt


I have no idea what I am doing
⛺︎ My Room
RSS: RSS

Guild Memberships:
Artifacts:
Dan Q Cruisin'I DIDN'T meet Dan Q on Melonland!Visited on Melon's 10th Anniversary!
« Reply #6 on: a Summer night » Embed

@Dan Q I have a question!
When adding new items to our feed, shall we write the new ones at the top or at the bottom? I imagine most readers order the items by looking at the pubdate, but what happens when that's not present? Does the order change based on the reader, or does it follow the usual "latest news on top"?

In most RSS feeds, for most feed readers, the order of the items does not matter.

The feed reader does two things:

1. A feed readers works out which items are new. To do this it will usually use the <guid> if present; failing that it will usually use some combination of the <link>, <title>, and <pubDate>, depending on what's available. If a new item is added to a feed this is how a reader will identify it as something it hasn't seen before.

2. A feed reader works out the order of the items. If present, it will use <pubDate>. Otherwise, it will assume that items it already saw (on previous synchronisations) are "older" than ones seen only on later synchronisations. <pubDate> is worth having, but feed readers can manage without it! Even if you put things in a random order.

For your own sanity, you probably want to put them in some kind of order though! Mine puts new items at the top. Either way works!

Logged

https://danq.me/_q26t/badges/dan-q-88x31-lighter.gif https://danq.me/_q26t/badges/dan-q-88x31-peekaboo-scroller.gif https://beige-buttons.danq.dev/beige-buttons-88x31.gif https://embed-html.danq.dev/embed-html-88x31.gif

Artifact Swap: PolyamorousI met Dan Q on Melonland!Doctor RedactedJoined 2025!
Pages: [1] Print Embed 
« previous next »
 

Melonking.Net © Always and ever was! SMF 2.0.19 | SMF © 2021 | Privacy Notice | Send Feedback | Supporters ♥ Forum Guide | Rules | RSS | WAP | Mobile


MelonLand Badges and Other Melon Sites!

MelonLand Project! Visit the MelonLand Forum! Support the Forum
Visit Melonking.Net! Visit the Gif Gallery! Pixel Sea TamaNOTchi
@000 MelonLand Zap! Want to Login or Join ? Forum Art Hub Chat Webring Editor Recent Edits Tenement Arcade Web Guides Graphics Catalogue Wiki Newsletters Image Stream
Melon's Sites TamaNotchi Textures PixelSea GifyPet MoMG Ozwomp Online Loom Videos Leaky Webring Melonking
Tools Melon Software ArtHub Embed Maker ML Passports
Outlinks Webrings Internet Phone Book HTML Energy Declarations Hackers & Designers Frutiger Aero Forum m15o's Web Services 32Bit Cafe iMood
Minecraft: Online
Join: craft.melonking.net