Search

Building a Generic RSS Parser Service with Cloudflare Workers

One job you’re sure to do many, many times in your web development career is:

  1. Go get some data from a URL
  2. Parse it
  3. Return it

If you’re lucky, the data is JSON because it’s such a ubiquitous and predictable data format that nearly any language can deal with it. But the data could be an RSS feed, which is a format for syndicating article-like data. I love RSS, but the format is generally XML not JSON, which is a bit harder to deal with. And Raymond Camden has a good point:

… the vast majority of RSS feeds don’t specify a CORS header to allow remote scripts to load them

CORS is a browser-level protection that can be a pain to work around. Follow that link for Raymond’s great take on using a Cloudflare Worker (thus is server-side and doesn’t have CORS restrictions) to fetch and parse RSS.

Need front-end development training?

Frontend Masters logo

Frontend Masters is the best place to grow in your career as a developer. We have courses on all the most important front-end technologies and beyond, from React to CSS, to backend with Node.js and Full Stack.

Leave a Reply

Your email address will not be published. Required fields are marked *

Frontend Masters ❤️ Open Source

Did you know? Frontend Masters Donates to open source projects. $313,806 contributed to date.