Skip to content

Generate a daily update playlist on Spotify based on the weather, date, and more.

License

Notifications You must be signed in to change notification settings

bay1877/spotify-daily-update

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

Spotify Playlist Daily Update

Generate a daily update playlist on Spotify based on the weather, date, and more.
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgements

About The Project

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.

Built With

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

This project assumes you have python installed.

Installation

  1. Clone the repo
    git clone https://github.com/bay1877/spotify-daily-update.git
  2. Enter the repo directory
    cd spotify-daily-update 
  3. Setup and enter the virtual environment.
    python3 -m venv venv
    source ./venv/bin/activate
  4. Install Python packages
    pip install -r requirements.txt

Setup

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.

Usage

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.

playlist

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

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Bradley Yoder - [email protected]

Project Link: https://github.com/bay1877/spotify-daily-update

Acknowledgements

About

Generate a daily update playlist on Spotify based on the weather, date, and more.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published