This Python script fetches the Billboard Hot 100 chart for a specified date and creates a private Spotify playlist containing the top 100 songs from that date.
- Python 3.x
- Spotipy
- BeautifulSoup
- Requests
-
Clone the repository:
git clone https://github.com/isotronic/top100-music-time-mashine.git
-
Navigate to the project directory:
cd top100-music-time-mashine
-
Install dependencies:
pip install -r requirements.txt
-
Obtain Spotify API credentials by creating an application on the Spotify Developer Dashboard.
-
Set the following environment variables:
export SPOTIPY_CLIENT_ID=your_spotify_client_id export SPOTIPY_CLIENT_SECRET=your_spotify_client_secret export SPOTIPY_USER=your_spotify_username
-
Adjust other parameters in the script as needed, such as the Spotify redirect URI and the scope.
-
Run the script:
python main.py
-
Input the date you want to create a playlist for in the format
YYYY-MM-DD
when prompted. -
The script will fetch the Billboard Hot 100 chart for the specified date, search for corresponding tracks on Spotify, and create a private playlist with those tracks.
-
Ensure that your Spotify account has the necessary permissions for playlist modification (
playlist-modify-private
scope). -
The generated playlist will be named based on the chosen date, e.g., "YYYY-MM-DD Billboard Top 100."
- This project uses Spotipy for Spotify API interaction and BeautifulSoup for web scraping.