One job you’re sure to do many, many times in your web development career is:
- Go get some data from a URL
- Parse it
- 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.