I want my scenario to create a new Webflow item whenever a new podcast episode is published on Spotify. The scenario should run automatically every 15 minutes.
Some facts:
Spotify does NOT offer a module that triggers whenever a NEW podcast is published.
They do have a module that can get ALL published episodes of a given podcast (“get episodes”).
The only episode timestamp provided by Spotify is a date (yyyy-mm-dd). No time.
I have set up a scenario that thus imports ALL episodes to Webflow. Now I need to set up some kind of filter so that I can run this scenario automatically (every 15 minutes or so), but that only imports NEW episodes to Webflow - not the ones that I’ve already imported. Otherwise, I will create duplicate items in Webflow. I first thought I could do this with a timestamp, but since Spotify only provides the publishing date, and not the time, that wasn’t a viable solution.
If your scenario runs every 15 minutes, then all you need is a filter that takes the podcast episode publish date and “accepts” it when the (publish date) is (greater than) (15 minutes ago).
If you need further assistance, please provide the following:
Please provide the output bundles of the Spotify List Episodes module by running the scenario (or get from the scenario History tab), then click the white speech bubble on the top-right of each module and select “Download input/output bundles”.
A.
Save each bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.
Are you thinking of a filter like this? The problem (at least I think) is that Spotify only outputs a date, and not the specific time a podcast episode was released.
In that case there’s no point running the scenario more than once a day.
In the filter you’ll need to use the built-in function parseDate with the publish date, and the operator should be a date comparison, and the value to compare against will now be addDays(now; -1)
This will assist in filtering all episodes from the previous day. Running this daily ensures that you obtain all episodes without duplicates and without missing any new data.
Podcasts are usually published in parallell on both Spotify and RSS aggregators like Apple Podcaster. I use the RSS module to trigger the scenario (“Watch RSS feed items”) and subsequently run the Spotify module. Then I can filter the episode titles from Spotify and the RSS-feed (they are identical) and thus combine the data.