Dynamic realtime profile ReadMe linked with spotify
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.4 KiB

  1. # Set Up Guide
  2. ## Spotify
  3. * Create a [Spotify Application](https://developer.spotify.com/dashboard/applications)
  4. * Put aside:
  5. * `Client ID`
  6. * `Client Secret`
  7. * Click on **Edit Settings**
  8. * In **Redirect URIs**:
  9. * Add `http://localhost/callback/`
  10. ## Refresh Token
  11. * Navigate to the following URL:
  12. ```
  13. https://accounts.spotify.com/authorize?client_id={SPOTIFY_CLIENT_ID}&response_type=code&scope=user-read-currently-playing,user-read-recently-played&redirect_uri=http://localhost/callback/
  14. ```
  15. * After logging in, save the {CODE} portion of: `http://localhost/callback/?code={CODE}`
  16. * Create a string combining `{SPOTIFY_CLIENT_ID}:{SPOTIFY_CLIENT_SECRET}` (e.g. `5n7o4v5a3t7o5r2e3m1:5a8n7d3r4e2w5n8o2v3a7c5`) and encode into [Base64](https://www.base64encode.org/).
  17. * Then run a [curl command](https://httpie.org/run) in the form of:
  18. ```sh
  19. curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Basic {BASE64}" -d "grant_type=authorization_code&redirect_uri=http://localhost/callback/&code={CODE}" https://accounts.spotify.com/api/token
  20. ```
  21. * Save the Refresh token
  22. ## Vercel
  23. * Register on [Vercel](https://vercel.com/)
  24. * Create project linked to your github repo
  25. * Add System Variables:
  26. * `https://vercel.com/<YourName>/<ProjectName>/settings/environment-variables`
  27. * `SPOTIFY_REFRESH_TOKEN`
  28. * `SPOTIFY_CLIENT_ID`
  29. * `SPOTIFY_SECRET_ID`
  30. * Deploy!