How to "watch" a JSON file for new items using Dates: New Make blog post

TL;DR

  • 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.

Problem Statement

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.

Screenshot_2023-08-30_120810

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:
https://www.make.com/pw-api/blogs/search-blogs?limit=1&offset=0&sort=Newest

However, there are no Trigger modules to watch JSON for changes.

Screenshot_2023-08-30_100851


Workaround: Data Store

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.

Step 1

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.

Screenshot_2023-08-30_110800

Step 2

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.

Screenshot_2023-08-30_100836

Step 3

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).

Step 4

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”.

Step 5

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:

Screenshot_2023-08-30_120839

Author name and blog post categories:

Here’s how it looks like in Discord



10 Likes

Hey there @samliew :wave:

Thank you so much for creating this great guide! :star_struck:

It’s great that we have the option to get a notification for a new blog post. Now, I don’t have to worry about missing an article.

Keep up the amazing work! :seedling:

4 Likes

I’ve made this into a live demo in the unofficial Make Discord server, in the #general channel!

If we find it useful I’ll build on it further.

Super cool! :stuck_out_tongue:

I wonder how the first module output looks like, so i will simulate it later

Thank you, this is very helpful.

A question: if the JSON file I’m getting isn’t ordered by date, how can have the scenario find the entry with the most recent date?

Welcome to the Make community!

Could you please create a separate topic for this?

While it’s tempting to continue an existing thread, a more effective approach would be to start a new topic. It helps other community users to respond to your query, and keeps our space organised for everyone. If you start a new conversation you are also more likely to get help from other users. You can refer others back to a related topic by including that link in your question. Thank you for understanding and keeping our community neat and tidy.

The “New Topic” link can be found in the top-right of the header:

Thanks!

1 Like