A simple lab that uses the Spotify library written in Golang. The example implemented performs the following:
- Generates a token required to login to the Spotify API
- Searches through all the playlists that contain the word "Christmas" in their name.
- Recovers all the songs for each one of the playlists until it has 40 different ones.
- Prints out the definitive Spotify christmas playlist we can use for next year's holiday season parties.
## Prerequisites
- Golang 1.20 or higher installed
- A spotify account. You can create one here. Additionally you will need to create a Spotify APP and generate the Spotify Account ID and the Spotify Secret. You can see how to create all this here.
- Recommended but not mandatory VS Code or a similar IDE
First you will need to set the environment variables that correspond to the Spotify configuration. If you use Mac OS, you can set them like this:
export SPOTIFY_ID=XXXXXXXXXXXXX
export SPOTIFY_SECRET=XXXXXXXXXXXX
If you are using Windows, you can set them like this:
setx SPOTIFY_ID "Variable value"
setx SPOTIFY_SECRET "Variable value"
You will need to download all the external libraries using:
go mod tidy
Finally, navigate to the /cmd folder and run the following command:
go run main.go