{"id":13529525,"url":"https://github.com/Aveek-Saha/spotify-box","last_synced_at":"2025-04-01T16:31:33.184Z","repository":{"id":43279610,"uuid":"303486957","full_name":"Aveek-Saha/spotify-box","owner":"Aveek-Saha","description":"🎧 Update a pinned gist to show your top Spotify tracks/artists.","archived":false,"fork":false,"pushed_at":"2022-03-10T08:55:55.000Z","size":37,"stargazers_count":10,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-23T17:06:48.201Z","etag":null,"topics":["gist","gistbox","pinned-gist","secrets","spotify","spotify-box","spotify-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aveek-Saha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-12T19:02:20.000Z","updated_at":"2024-02-28T15:36:00.000Z","dependencies_parsed_at":"2022-08-12T10:21:36.362Z","dependency_job_id":null,"html_url":"https://github.com/Aveek-Saha/spotify-box","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aveek-Saha%2Fspotify-box","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aveek-Saha%2Fspotify-box/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aveek-Saha%2Fspotify-box/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aveek-Saha%2Fspotify-box/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aveek-Saha","download_url":"https://codeload.github.com/Aveek-Saha/spotify-box/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246670544,"owners_count":20815003,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gist","gistbox","pinned-gist","secrets","spotify","spotify-box","spotify-plugin"],"created_at":"2024-08-01T07:00:37.107Z","updated_at":"2025-04-01T16:31:32.892Z","avatar_url":"https://github.com/Aveek-Saha.png","language":"JavaScript","funding_links":[],"categories":["others","External Services"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg width=\"450\" src=\"https://user-images.githubusercontent.com/31800695/95853311-d40d3400-0d72-11eb-86f5-460d4214001c.png\"\u003e\n  \u003ch3 align=\"center\"\u003espotify-box\u003c/h3\u003e\n  \u003cp align=\"center\"\u003e🎧 Update a pinned gist to show your top Spotify tracks/artists\u003c/p\u003e\n\u003c/p\u003e\n\n---\n\n\u003e 📌✨ For more pinned-gist projects like this one, check out: https://github.com/matchai/awesome-pinned-gists\n\n# Setup\n\n## Prep work\n\n### GitHub\n\n1. Create a new public GitHub Gist. (https://gist.github.com/)\n1. Create an access token with the `gist` scope and copy it. (https://github.com/settings/tokens/new)\n\n### Spotify\n\n1. Go to the Spotify Developer Dashboard and log in. (https://developer.spotify.com/dashboard/)\n1. Create an app with a name and description.\n1. Copy the `Client ID` and `Client secret`.\n1. Click on edit settings and add `http://localhost:5000/` as a redirect URI.\n1. In your browser enter this URL and replace \u003cclient_id\u003e in this url: \n    ```\n    https://accounts.spotify.com/authorize?client_id=\u003cclient_id\u003e\n    \u0026response_type=code\u0026redirect_uri=http://localhost:5000/\n    \u0026scope=user-top-read%20user-read-recently-played\n    ```\n1. After this you should see an url like this in your address bar: `http://localhost:5000/?code=\u003ccode\u003e`. Copy this code query parameter.\n1. Use this website to generate a base 64 string of the form `client_id:client_secret`. (https://www.base64encode.org/)\n1. In a terminal, run the following command and use the base 64 encoded string and code from the previous steps.\n\n    ```command\n    curl -H \"Authorization: Basic \u003cbase 64 str\u003e\" -d grant_type=authorization_code -d code=\u003ccode\u003e \n    -d redirect_uri=http://localhost:5000/ https://accounts.spotify.com/api/token \n    ```\n1. A JSON response containing a `refresh_token` will be returned. Copy this value.\n\n## Project setup\n\n1. Fork this repo\n1. Go to the repo **Settings \u003e Secrets**\n1. Add the following environment variables:\n   - **GH_TOKEN:** The GitHub access token generated above.\n   - **GIST_ID:** The ID portion from your gist url: `https://gist.github.com/Aveek-Saha/`**`8335e85451541072dd25fda601129f7d`**.\n   - **CLIENT_ID:** Your Spotify `client_id`.\n   - **CLIENT_SECRET:** Your Spotify `client_secret`.\n   - **REFRESH_TOKEN:** The `refresh_token` generated.\n   - **TYPE:** The type of data generated on the gist. Can be one of `top_tracks`, `top_artists` or `recently_played`.\n   - **TIME_RANGE:** The time frame for computing `top_tracks` or `top_artists`. Can be one of `long_term`, `medium_term` or `short_term`.\n\n## Credits\nThis code was inspired by [@matchai's bird-box](https://github.com/matchai/bird-box).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAveek-Saha%2Fspotify-box","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAveek-Saha%2Fspotify-box","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAveek-Saha%2Fspotify-box/lists"}