RSS to JSON with Make

📣
I use Make (formerly Integromat) for my personal, creator, and business automation needs and am an affiliate. If you sign up using my affiliate link, you get one month of the Pro plan for free.
If you have an RSS feed that you would like accessible as JSON, I've got a Make scenario for you.

RSS2JSON Make Scenario
RSS2JSON Make Scenario

To summarise, you create a custom Make webhook that you can invoke wherever you need your JSON output, it will fetch the RSS from the feed, turn it into the JSON structure you need, and return it as the webhook response.

My use case is that I want to get a Quote of the Day (QotD) into my Obsidian daily note template.1 There is a popular source for QotD in Obsidian using api.quotable.io from lukePeavey/quotable, however this service has started to fail pretty regularly and I wanted a more reliable tool.

You can apply this scenario to any RSS feed you like, just change the RSS URL and the JSON structure to fetch the data you need but you can see what you may want to configure below.

You can create the scenario manually with the instructions below, or to speed things along a little if you're just after a QotD, download the zipped up blueprint here: Download

To use a blueprint, create a new scenario, click on the triple-dot menu and click on Import Blueprint.

Import Blueprint
Import Blueprint

Configure Custom webhook module

  1. Create a new webhook.

Configure RSS module

RSS Module
RSS Module
  1. Set URL to the source you want to use.
    I used http://feeds.feedburner.com/quotationspage/qotd for daily quotes.

  2. For a QotD I only need one item. If you need to fetch multiple, change Maximum number of returned items.

Configure JSON module

JSON Module
JSON Module
  1. Select the Data structure you would like returned by the webhook or click on Add to create it. For my purposes, I only needed the quote and the attribution.

    The following screenshot shows you what part of this data structure looks like with the definition for 'quote'. The 'attribution' definition is right below it and looks the same.

Data structure definition
Data structure definition
  1. Once you have a data structure, you will be able to map the RSS fields to your JSON fields.
    Note: You may have to Run this module only to get the RSS structure for mapping purposes before the source mapping is available.

Configure webhook response

Webhook module
Webhook module
  1. Finally, define your webhook response to include the JSON you just constructed and set the response headers to return Content-Type application/json.

Use the webhook

Test your custom webhook out by pasting it into your browser. My output looks like this:

Loading...
{ "quote":"\"I might repeat to myself slowly and soothingly, a list of quotations beautiful from minds profound - if I can remember any of the damn things.\"", "attribution":"Dorothy Parker" }

I'm using this webhook in Obsidian, but it can be used anywhere. Just make sure that if you're using a third-party RSS feed that you are considerate with your usage.

In Obsidian, I created a Templater script function called qotd which I invoke in my daily note template:

Loading...
async function qotd() {   try {     const res = await fetch(`YOUR_CUSTOM_WEBHOOK`);     const body = await res.json();     return `> [!quote] Quotable\n> ${body.quote}\n> — ${body.attribution}`;   } catch (e) {     return `> [!quote] Quotable\n> Error fetching quote`;   } } module.exports = qotd;

Conclusion

This is a versatile workflow that can be adapted to anything else you might need RSS for where you don't want to have to handle parsing the XML yourself. Perhaps what you're using doesn't support RSS or you don't want the overhead of adding an RSS parser to your libraries.

I also have a version of scenario that I use to trigger workflows for my podcasts STEAM Powered and NepoPod because there's a delay between when I publish an episode on my podcast hosting platform and when Apple Podcasts updates. This scenario lets me fetch the Apple Podcast-specific identifiers and pass them around to where I need them so the utility really is what you make of it.


Footnotes

  1. I may document how I use Obsidian in my personal and professional workflows at some point, but one small part of it is daily journalling. In the past, I have used apps like Day One, 5 Minute Journal, and stoic. where quotes and prompts feature in the template and I wanted to reproduce this experience in Obsidian. ↩

Published September 10, 2024