This Python program creates a Spotify playlist of the Billboard Hot 100 songs for a specific date.
- Clone the repository or download the Python file.
- Install the required libraries using pip.
- Obtain the necessary credentials:
- Spotify: Create a Spotify developer account and create an application to obtain the
CLIENT_ID
,CLIENT_SECRET
, andREDIRECT_URI
. Set theREDIRECT_URI
as a valid redirect URI for your Spotify application.
- Set the environment variables:
CLIENT_ID
: Your Spotify application's client ID.CLIENT_SECRET
: Your Spotify application's client secret.REDIRECT_URI
: Your Spotify application's redirect URI.
- Run the Python script in your terminal or IDE.
- Enter the date you want to travel to in the format
YYYY-MM-DD
when prompted. - The program will scrape the Billboard Hot 100 songs for the specified date from billboard.com.
- It will authenticate with Spotify using your provided credentials.
- The program will search for each song on Spotify and retrieve the track URI.
- It will create a new private Spotify playlist with the name
[travel_date] Billboard 100
(e.g.,2023-06-06 Billboard 100
) if it doesn't already exist. - Finally, the program will add the retrieved song URIs to the playlist.
Ensure that your Spotify account has the necessary permissions to create private playlists and modify your playlists.
Language: Python
Libraries: spotipy
, BeautifulSoup
, requests
, datetime
, and os
Spotify Web API - spotipy
uses Spotify Web API
behind the scenes.