Finds concerts near you based on your Spotify listening history and emails them to you. It can also create Google Calendar events for the concerts it finds.
This was made so that I can find out when artists I love are in town. I want something that just focuses on the artists I listen to. No artists recommended by an AI. No newsletters listing concerts I'm not interested in.
Developed by cparsell
Made for Google Apps Script
- Nove 20, 2024: Limited the scope needed. It was requiring general GMail access which is not necessary. I limited the scope to just be able to send email, have calendar event access, and access to the Music Spider spreadsheet.
- Nov 19, 2024: I included instructions for how to add the CommonLib library.
- Feb 2024: Added a second URL column and the ability to save a second ticket URL. If the first result comes from Ticketmaster, then a second result on SeatGeek will be added to the 'Alt URL' column.
- Sept 2023: Added ability to search results from Resident Advisor's API. One has to specify the region to search with a code(e.g. 218 is the Bay Area, 8 is New York...) so that's not well integrated but it works.
It can gather the names of artists from Spotify's API from three sources:
- Top Artists - Spotify keeps a list of the artists you listen to the most. The API will return this list based on long-term, medium-term, and short-term listening history
- Artists you follow
- Artists in a specified playlist
These are all optional and you can configure it to gather these from any or all of these in the config.gs
file. It writes the artist's names to the Artist Sheet.
It then searches Ticketmaster's and Resident Advisor's API for events with these artist's names as keywords and in the area you specify. It writes any event matches into the Event Sheet.
Then it sends an email (e.g. weekly) listing these events.
- Google account
- Spotify account
- Ticketmaster API account
- Copy template Google Spreadsheet to your Google Drive
- Add CommonLibrary to the project (renaming it CommonLib) using the ID: 1JtiVtuS5lQtj_u-EJkdjcRLMjMyu_Bqsch7fWvtFEDG6I4tZ3qM7vRKM
- Set up API keys for (Spotify API, Ticketmaster). Put keys in
config.gs
file. In the config file, you can also change settings to your liking. - Deploy as web app.
- Run the deployed webapp in browser.
- Copy URI given IN BOLD in web app into Spotiy App settings under Redirect URI (STEP 3) NOTE: Do NOT use URL! It is different for me at least. Save.
- Set up triggers in Apps Script
- A sample configuration file is included:
_config.example.gs
. Replace the values with your own API keys and preferences. - Paste your API keys from (Spotify API, Ticketmaster) accordingly
- Paste your
latlong
to coordinates of your rough location using (latlong.net)[https://www.latlong.net/] - If you want to get artists from your listening history (the artists you most listen to), leave
getTopArtists
set totrue
. Otherwise change it tofalse
. - If you want to use artists that you follow, leave
getFollowing
set totrue
. Otherwise change it tofalse
. - To collect artist names from a Spotify playlist, leave
getArtistsFromPlaylist
set totrue
.- To get the playlist ID, get a share link from Spotify. If the link looks like
https://open.spotify.com/playlist/2323bn4n2324nb224b2442?si=3568n535n85685685n
then the ID is2323bn4n2324nb224b2442
. Past this into the value forplaylistId
.
- To get the playlist ID, get a share link from Spotify. If the link looks like
- To save events as a Google Calendar event, set
createCalendarEvents
totrue
and provide the calendar ID. This usually looks something like[email protected]
- Go to Apps Script from the sheet (Extensions > Apps Script)
- Click Deploy > New Deployment > Web app and it will provide a link to the deployed web app.
- Copy the link and go to this address in your web browser.
- This page will give you further instructions to:
- Navigate to your app via the Spotify App Dashboard
- Add the given URI (the one given on this page, don't use the URL you went to) to the Redirect URIs field, found under "Edit Settings"
- Go to the given URL, log into the desired user's Spotify account, and approve access.
- You should be redirected back to a success page on Google App Script.
- Now the script should have authorization to get your user's info (playlists, top artists, etc)
This will set up Apps Script to regularly update artists, events, and send you an email. Change the timing of these to your preference. If you do not want an email, just don't create this trigger.
- In the Apps Script project, go to Triggers on the left sidebar
- No trigger needs to be created for this. This runs automatically when the spreadsheet is opened. For this reason, it will probably ask for authorization to run the script when the spreadsheet is opened.
This will refresh your top artists and, optionally, gather artist names from any playlists you provide.
- Click Add Trigger
- Function to run: refreshArtists (the function that updates your Spotify artists)
- Event source: Time-driven
- Week timer
- Every Monday (or your preference)
- 2am to 3am
- Save.
This searches for new future events.
- Click Add Trigger
- Function to run: refreshEvents (the function that looks for new events on Ticketmaster)
- Event source: Time-driven
- Week timer (or your preference)
- 4am to 5am
- Save.
This sends an email listing all known future events.
- Click Add Trigger
- Function to run: sendEmail (send out a regular email with events)
- Event source: Time-driven
- Week timer
- Every Monday
- 6am to 7am
- Save.
Your copy of this code may not be up-to-date if I have updated the repository after you made your copy. There are two ways to update the code in Apps Script:
- Copy and paste each file into your corresponding copy of each file.
- Install Google Apps Script Github Assistant, hook it to your GitHub account (see their ), and pull from the Music Spider repo.
- Note: If the config.example.gs template changes, maek sure you don't copy over your API keys and other personal information.
- Authentication web app functions were adapted from Spotify-Backup-GAS. This was extremely helpful in getting Spotify API authentication to work.