Filtering podcast episodes from Spotify

Hello!

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.

Very grateful for any ideas!

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”.
Screenshot_2023-10-06_141025

A.

Save each bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.

Uploading them here will look like this:

module-1-output-bundle.txt (12.3 KB)

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles in this manner:

  • Either add three backticks ``` before and after the code, like this:

    ```
    input/output bundle content goes here
    ```

  • Or use the format code button in the editor:
    Screenshot_2023-10-02_191027

Providing the input/output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

This will allow others to better assist you. Thanks!

samliewrequest private consultation

2 Likes

Hi, and many thanks for your reply.

Here is the output bundle:
spotify_output_bundle.txt (915.2 KB)

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)

2 Likes

Hi @Jacob1

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.

If you require additional assistance, please don’t hesitate to reach out to us.
MSquare Support
Visit us here
Youtube Channel

2 Likes

This has a slight mistake which won’t work, can you spot it?

3 Likes

I managed to solve this with a workaround:

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.

2 Likes

Hey there @Jacob1 :wave:

Very creative workaround indeed!

Keep up the amazing job! :party_blob:

2 Likes