I make/maintain Spotify playlists created from AskReddit threads!
You may notice interesting results. This is because:
- Search strings are difficult. Comments come in many shapes and sizes so I do my best to guess what song name is being requested.
- Spotify search returns covers/remixes as the first result sometimes -- For example,
query=Basket Case by Green Day
returns a cover whilequery=Basket Case
returns the original. - Results can be duplicated (or more) if similar comments/titles are upvoted equally.
- Create a
secrets.json
file in the root.
{
"reddit": {
"userAgent": "Your user agent string",
"clientId": "Your Reddit client id",
"clientSecret": "Your Reddit client secret",
"username": "Your Reddit username",
"password": "Your Reddit password"
},
"spotify": {
"clientId": "Your Spotify client id",
"clientSecret": "Your Spotify client secret",
"redirectUri": "Your Spotify App's redirect uri"
}
}
-
Update your
config.json
with your own playlist IDs and the IDs for the reddit threads you want to scan. Make sure the playlist is "public" which means it has to be "added to profile" now in Spotify. -
Run it with
yarn start
and open your browser to http://localhost:3000. Log in/authorize and the bot will begin!
$ yarn start
yarn run v1.21.1
$ node --experimental-modules src/index.mjs
(node:968) ExperimentalWarning: The ESM module loader is experimental.
Authorizing with Spotify...
Searching Reddit thread embv3x...
Searching Reddit thread 9k5zfb...
Searching Reddit thread cw1d3h...
Searching Reddit thread dykjt8...
Found 110 Reddit comments (after filtering).
Found 103 Reddit comments (after filtering).
Found 40 Reddit comments (after filtering).
Found 70 Reddit comments (after filtering).
Found 18 songs on Spotify.
Replacing songs on playlist...
Found 47 songs on Spotify.
Replacing songs on playlist...
Found 45 songs on Spotify.
Replacing songs on playlist...
Found 53 songs on Spotify.
Replacing songs on playlist...
Done in 28.68s.