Did you know you can turn almost any sub-Reddit into an RSS feed by adding .RSS
to the url?!
RSS? Ok, by why is this useful? 🤨
Because it's basically an API to GET the recent posts, in XML format, without all the setup of enabling the API!!
And with a little data transformation using Appsmith, the raw XML can easily be turned into an array of JSON objects to build a feed viewer. From there, all kinds of other integrations could be built, passing data from the selected feed to the next function.
For this tutorial, I'll be parsing data from Reddit.com using the .RSS
url, but this method could be applied for viewing any XML data source.
⚙️ Setup
Create a new Appsmith app and add the following Widgets:
Name | Type |
subreddit | Input/Text |
results | Table |
update | Button |
preview | Iframe |
- Add a new Datasource>APIs>Create New:
Name: getXML
GET: https://www.reddit.com/r/{{subreddit.text}}/.rss
- Enter a sub-reddit name in the subreddit Input Widget
- Run
getXML
Now that the API response is populated, the auto-complete will help us navigate the results and bind the correct property of the response to a the results
table Widget.
- Bind the
results
Table-Widget to thegetXML
API{{xmlParser.parse(getXML.data).feed.entry}}
- Bind the
preview
Iframe-Widget to the 3rd link in thecontent
property of the "currentRow" - DEPLOY! 🚀
{{results.selectedRow.content.split('"'
)[3]}}
This line 'splits' the content
property of the getXML
API results by the "e;
pattern, and creates and array from the results. The 4rd value in this list is the one we want for the preview, but the list is zero-based. So [3] gets the 4th item from the array.
Thanks for reading! Even though RSS isn't as popular these days for personal use, there are still TONS of uses for no-code solutions! Here are a few resources to help inspire your own integration: