🤘 👹 🤘
This is a Command Line Interface tool to play a random album from Rolling Stone Magazine's The 500 Greatest Albums of All Time list and keep track of the albums you've already listened to. 🎵
- Run
npm i
- Copy
.env.localand rename to.env - Copy
rolling-stone-500-fresh.jsonand rename torolling-stone-500.json(this is where your plays, likes, favorites while be saved)
- Go to Spotify for Developers
- Create a Spotify Developer App
- Go to: https://developer.spotify.com/dashboard
- Click “Create an App”
- Add name and description (i.e. CLI Rolling Stone 500)
- After creation, copy your:
- Client ID
- Client Secret
- Add a Redirect URI
- Under Redirect URIs, add:
http://127.0.0.1:8888/callback
- Under Redirect URIs, add:
- Authorize the App to Get a Code
- Replace
YOUR_CLIENT_IDin the following link and open in browser:
https://accounts.spotify.com/authorize?client_id=YOUR_CLIENT_ID&response_type=code&redirect_uri=http://127.0.0.1:8888/callback&scope=user-read-playback-state%20user-modify-playback-state- Log in and approve the permissions
- You’ll be redirected to a URL that looks like: http://127.0.0.1:8888/callback?code=`LONG_SPOTIFY_CODE_HERE`
- Copy that
LONG_SPOTIFY_CODE_HEREcode and save toconst code = 'PASTE_YOUR_LONG_SPOTIFY_CODE_HERE'line of/setup/getRefreshToken.ts
- Replace
- Run
npx tsx setup/getRefreshToken.tsin your terminal and save the console logged output value in your terminal to.envSPOTIFY_REFRESH_TOKEN- NOTE: You only need to run this once
⸻
Before you start, make sure: - You have the Spotify app open - You’re logged into Spotify - Your Spotify app is currently playing something, so an "active device" is available for playback
Then run:
npm run shell
Upon launch of the interactive command-line shell, a random album from Rolling Stone's Top 500 Greatest Albums of All Time will play. From there, you can run commands to like, score, add notes, tag, play next album, etc.
retry-▶️ retries the current album (in case playback failed initially) (might not be working well yet)next- ⏭️ loads a new random unplayed album, starts playback, and updates metadatalike- 💚 marks album liked: truescore [1–5]- ⭐ adds a rating out of 5 (i.e. 4.5)note [your note]- 📝 adds a note to the album / appends note listtag [tags...]- 🏷️ adds categories, comma-separated (e.g. tag dinner party, chores)show- 📋 displays current album info, score, notes, and tags (from json file)help- ℹ️ lists all available commandsexit- 🚪 saves and quits the shell
⸻
Each album is tracked in rolling-stone-500.json, with the following fields:
"played"- whether it’s been played (default false)"liked"- whether you've liked the album (default false)"score"- score (1–5) (keeping until I decide)"notes"- your notes on the album (as many as you’d like, the list will be appended)"tags"- categories / tags for a future feature where user can select random album from, say, "dinner party" or "chores"
Changes are automatically saved after every command
⸻
- Option to only play albums that are:
- Liked
- Selected by tag
- Option to play any album, played or not
- Option to Add to Liked Songs on currently playing song (Spotify API willing)
- For albums that can't be found on Spotify with the passed in query:
- Create an error log to store that info
- Manually check if another search query will work for that album in Spotify
- Use that query moving forward
- Elegant user-friendly error-handling if not (i.e Update json if user listens another way after prompting)
- User can run on different machines with the same saved data (easy way: remove user's json file from .gitignore so they can just pull down from and push to the same branch)
- Option to add other collections
- Option to queue next album before current album is over? (Spotify API willing)
- Log history to textfile
- Shell style updates with chalk and boxen
🤘 👹 🤘