Changing the Way We Listen: A Playlist For All Music Fans

Emma McDowall
Entrepreneurship Technology Class Blog
6 min readApr 13, 2018

Created By: Malek Alkhatib, Jessica Choi, and Emma McDowall

We created a zap where you can get daily information about the radio station of your choice. With this zap you can see what songs were the most played, and the amount of times it was played. With this calculation music producers can see the demand of certain songs or artists. You can forecast specific trends of popular music, where you can also focus on genres. Trends are constantly changing, and having a simple chart, or spreadsheet with the top hits can be useful for anyone in the music industry. With these trends you can monitor daily activity of radio stations and compare them to one another.

We thought this information would come in use for Spotify users. The scraped data from the spreadsheet can now be automatically created into a playlist for users. Radio stations are not as easy to listen to on the go and this tool allows users to have playlists that are updated weekly by the radio station of their choice. These curated playlists put the top played song from the day and makes it easy for people to find the top hits. Radio stations can get notifications when their information gets scraped and this allows them to see the demand of their station.

Spotify is one of the most popular music streaming applications and will allow users to benefit from the on-the-go streaming application so they do not have to listen to advertisements or other radio commentary. The combination of mainstream radio hits and Spotify will change the way users get to experience their favourite artists.

How it Works: A Step-By-Step Explanation

Step 1: Zapier Setup

To create our automation, we used Zapier. To start the automation, create a new Zap. The first app we want to use is a page scraper, in our case we used “Apify”. If you do not have an Apify account you can go to their website and create a new account. Connect your Apify account to Zapier.

Step 1

Step 2: Apify Setup

This is where things get complicated, so make sure to follow these steps exactly. Go to the Apify website. Here we want to create a crawler, a crawler is just a line of code that sorts through the information on a website and extracts the information that you need. In our case we will extract the song names from the recently played songs on the AMP radio station. We create a new crawler.

Step 2

Fill out the custom ID with anything, this is just the name of the crawler. Paste the URL of the radio stations recently played section. Now, in a new tab go to your selected website webpage, we need to get some information from there.

Highlight the name of any recently played song then right click on it, choose “Inspect”. This will show you a whole mess of code. All we need is the variable name of the songs on the website, copy it because we will need to paste it into our crawler code.

Step 2: Continued

In the “Page function” area back in Apify, paste the following code:

function pageFunction(context) {var $ = context.jQuery;var results = [];$(‘insert song variable name here’).each(function() {results.push({title: $(this).text()});});return results;}

In the section of the code that says, “insert song variable name” paste the title that you previously copied from your radio stations website. Press save.

Step 2: Continued

Step 3: Try Running Your Crawler

Move to the “Run Console” tab in the current Apify crawler then choose the “Results” tab then press “RUN”. Depending on how many songs are in the list, you may get an error saying the list is too long, don’t worry, Apify gives you the option to open the results in a new window.

Step 3

Step 4(optional): Schedule the Crawler

In order to get a daily playlist, we can set up a scheduler for our little crawler! In the “Scheduler” section in Apify, create a new scheduler and give it a name. Go to the “Crawler” tab and select the crawler we created from the dropdown menu and press save. This will ensure we get a new playlist daily.

Step 4

Step 5: Continue Zapier setup

We left off on the “Set Up Options” section in Zapier. Here we just want to select the crawler that we want to run, so choose the custom ID that you created in Apify and continue. Then fetch and continue, the test should be successful and you’re ready to move to the next section. Press continue.

Step 5

Step 6: Set Up Google Sheets

Step 6

Now we want to set up our google sheet to accept our song list. Using your Gmail account, create a new empty spreadsheet. Give it a name, and give column A1 a name as well.

Now let’s come back to Zapier and finish setting up google sheets. Select “Google Sheets” as our next action app. Now we’re in the choose action section. In the create section press on “show less common options” and select “Create Spreadsheet Row(s)”. Press save + continue, connect your Gmail account and press save + continue.

Now follow this part carefully. In the “Spreadsheet” dropdown menu choose the new spreadsheet that we made. In the “Worksheet” section select “Sheet1” from the dropdown menu. In the “Rows” section select “Results Title” in the “Insert Field” menu. Press continue. Press finish!

Step 6: Continued
Step 6: Continued

Step 7: Connect to Spotify

Now for the final step we want to connect to our Spotify account and finally create the new playlist! To set this up, you will need to create a new playlist on your Spotify account to accommodate our new radio playlist.

Now back on Zapier, lets add one more action! Select Spotify as our new action app, in the “Create” section select “Add track to playlist” and continue. Connect your Spotify account to Zapier and continue. Select your newly made Spotify playlist, and the first track from the dropdown menus. Press continue.

Step 7

Send test to Spotify, now watch your Spotify playlist magically update! Now finish and turn on and name your Zap!

--

--