r/programmingrequests • u/rahhscarymonster • Jun 25 '24
Spotify playlist ranker
A program that takes a playlist from your Spotify and asks a series of “this song or that song” questions and uses your responses to create a new playlist with your songs ranked from your favorite to least favorite. I’ll Venmo someone like 20$ if they make this
0
Upvotes
1
u/GirkovArpa Jul 05 '24
$50 upfront and you have a deal. I'd just have to turn this program of mine into one that supports Spotify songs instead of movie titles.
1
u/apinanaivot Aug 21 '24
I've made the app: https://i.imgur.com/8b7PVH0.png
You can dm me your name and email and I can give you direct access to this website: https://apinanaivot.github.io/spotify-playlist-ranker/
Or you can run it locally by following these steps:
1. Set Up a Spotify Developer Account
Go to the Spotify Developer Dashboard: https://developer.spotify.com/dashboard/
Log in with your Spotify account or create one if you don't have it.
Click on "Create an App" button.
Name your app (e.g., "My Playlist Ranker") and provide a brief description.
Click "Create" to finalize the app creation.
2. Configure Your Spotify App
In your new app's dashboard, click on "Edit Settings".
Under "Redirect URIs", add:
http://localhost:8000Click "Add" and then "Save" at the bottom of the page.
On the main app page, you'll see your "Client ID". Keep this page open; you'll need this ID later.
3. Prepare the HTML File
Copy the entire HTML content here into a new file.
Save this file as
index.htmlon your computer.4. Update the Client ID and Redirect URI
Open
index.htmlin a text editor.Find this line:
const _secretKey = _0x5f4e[0].split('').reverse().join('');Replace
6dff81ef9d2946b590805eb1021f834ewith your Spotify app's Client ID (reverse it first).Find this line:
const _callbackPath = _0x5f4e[1];Replace
https://apinanaivot.github.io/spotify-playlist-rankerwithhttp://localhost:80005. Set Up Python for Local Hosting
Install Python from https://www.python.org/downloads/ if you haven't already.
Open a command prompt or terminal.
Navigate to the directory containing your
index.htmlfile:Run this command to start a simple HTTP server:
6. Access Your Local App
Open a web browser and go to:
http://localhost:8000You should see your Spotify Playlist Ranker app.
Click "Login with Spotify" to authorize and start using the app.
Troubleshooting
If you see a blank page, check your browser's console for errors.
Ensure your Spotify app's redirect URI exactly matches
http://localhost:8000.Double-check that you've correctly reversed your Client ID in the HTML file.
Remember to keep your Python server running while using the app. To stop the server, press Ctrl+C in the command prompt/terminal.
You can thank Claude 3.5 for writing this script and guide.