Generate a daily update playlist on Spotify based on the weather, date, and more.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
This project creates a fun way to hear about your day, through music. Listen to a playlist curated just for your day. Gather information like the day of the week & month as well as the weather & temperature. The possibilities with this daily playlist are endless. More songs/categories can be added to the user's delight.
To get a local copy up and running follow these simple steps.
This project assumes you have python installed.
- Clone the repo
git clone https://github.com/bay1877/spotify-daily-update.git
- Enter the repo directory
cd spotify-daily-update
- Setup and enter the virtual environment.
python3 -m venv venv source ./venv/bin/activate
- Install Python packages
pip install -r requirements.txt
Before running the script, you need to first do some setup to give Spotipy API access to your Spotify account. You should do the following.
-
Register your app with the Spotify Developer Dashboard
-
Generate the right credentials to make calls to the Spotify API
-
Fill in the following environment variables in the run script
export SPOTIPY_CLIENT_ID='your-spotify-client-id' export SPOTIPY_CLIENT_SECRET='your-spotify-client-secret' export SPOTIPY_REDIRECT_URI='your-app-redirect-url'
Please follow here for more detail on Authorization Code Flow.
Next, you should also update the path to your project directory in run.sh
.
Lastly, update three python global variables for your Spotify username, desired playlist name, and the city you live in.
After following the steps in the Setup section, you should be able to run the script with the below.
./run.sh
You should see a similar playlist created as a playlist on your Spotify account.
The run script will handle setting the proper environment variables as well as activating the venv. While you can run this program manually, it is best run automatically once a day. sRunning once a day at the same time is a perfect use for a cronjob. Checkout this cron refresher for more information on the tool. For Mac users, you may have to add extra permissions, see here.
To run this once a day at 7 AM, enter crontab -e
on the command line. This will open up a text editor (likely VIM). Then add in the following, replacing FULL_PROJ_DIR_PATH
with the full path to the project directory, and save+exit the file.
0 7 * * * /FULL_PROJ_DIR_PATH/run.csh > FULL_PROJ_DIR_PATH/log.txt
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Bradley Yoder - [email protected]
Project Link: https://github.com/bay1877/spotify-daily-update