Thursday | 25 APR 2024
[ previous ]
[ next ]

RSS Feeds

Title:
Date: 2022-02-22
Tags:  

I wanted to try syndicating my blog to dev.to as they take rss feeds and convert them to drafts. So this meant creating an rss feed for blog which was pretty straightforward.

I first created a rss feed based off other blogs that I follow and then I stuck it into a validator to have it show me my errors. Much faster than actually reading any sort of documentation!

This is the validator I used:

https://validator.w3.org/feed/

The link to my feed:

https://nivethan.dev/devlog/rss.xml

I only filled in the attributes that were mandatory and I had to do a bit of massaging to get the dates to show up in ISO format. The massaging was actually pretty easy, it was just using the toISOString function in javascript.

Here is a quick example.

<feed>
    <title>nivethan's devlog</title>
    <link href="https://nivethan.dev/"/>
    <updated>2022-02-21T22:42:21.146Z</updated>
    <author>
        <name>nivethan</name>
    </author>
    <id>https://nivethan.dev/</id>
    <entry>
        <title> Installing UniVerse</title>
        <link href="https://nivethan.dev/devlog/installing-universe.html"/>
        <id>https://nivethan.dev/devlog/installing-universe.html</id>
        <updated>2022-02-21T05:00:00.000Z</updated>
    </entry>
</feed>

My rss feed does validate but it triggers a few warnings about content and dates being duplicated. I'm ignoring them for now because I just want my blog posts to show up as drafts on dev.to. Maybe in the future I'll add a summary.

Edit - 23FEB2022 - RSS exists but devto isn't importing from it. I'll need to take a look at some point.