- This example shows how to create a scenario to notify you when a new Make blog post is released
- The Make blog does not have an RSS feed, so a workaround is used - by fetching the JSON of the latest post from the server and getting the last scenario run date from the Data Store
- A filter is then used to check if the blog post in the JSON has a later date than the date in the Data Store. If it does, it updates the date in the data store, and sends a notification to a Discord channel.
I wanted to make a scenario to notify me when a new Make blog post is released, but the Make blog does not have an RSS feed.
I used the browser console to see if the blog posts can be scraped (dynamic or static content), but I found something better - to display the latest blog posts, the website fetches the latest blog posts from the server in a JSON format. I copied the URL of the request.
I then realised I could change the limit query string value to “
1” just to get the latest item:
However, there are no Trigger modules to watch JSON for changes.
Modules that observe for new items usually store an ID or date/timestamp so that it can identify which items are newer in a later run. As the JSON file needs to be retrived using a HTTP module, which does not keep track of new items, I thought of using a Data Store to store the date of the latest blog post.
I created an “Updates” Data Store with the key set to “Make-Blog”, and a date field to store the time of the last scenario run.
On each scheduled run (I set it to daily because I don’t expect more than one post per day), I made the HTTP module fetch the JSON, and get the “last run” date value from the data store.
I made a filter to check if the item from the blog post has a date “Later than or equal to” the date in the data store (the “or” “Does not exist” is for the first run, when the data store is empty, or if I want to manually reset it by deleting the item with the “Make-Blog” key from the data store).
I then update the data store with the current date when the item returned in the JSON is newer, using the same key “Make-Blog”.
Now that I have the new blog post in a bundle, I can send the data anywhere.
In my case I wanted to update a notifications channel in a Discord server:
Setting a preview image:
Author name and blog post categories: