Coder Social home page Coder Social logo

samiulutshaw / readme-spotify-status Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sndrjhlncgr/readme-spotify-status

0.0 0.0 0.0 79 KB

Spotify status for readme files

Home Page: https://readme-spotify-status-rho.vercel.app/api/run-spotify-status.py

License: MIT License

Python 26.26% Jinja 73.74%

readme-spotify-status's Introduction


Spotify Status (README)

View what you listen at spotify.

GitHub issues GitHub forks GitHub stars GitHub license

Image of Sandro Cagara

Demo

s4nx Playing Now

Spotify for Developers

  • Create a Spotify for Developers account
  • Get Credentials
    • Client ID
    • Client Secret
  • Go to Edit Settings
  • Find Redirect URIs:
    • Add http://localhost/callback/

Get the Refresh Token from Spotify

  • Navigate to the following URL:
    Note: copy your Client ID and paste in {SPOTIFY_CLIENT_ID} below.
https://accounts.spotify.com/authorize?client_id={PUT_YOUR_SPOTIFY_CLIENT_ID_HERE}&response_type=code&scope=user-read-currently-playing,user-read-recently-played&redirect_uri=http://localhost/callback/
  • After logging in, get the {GET_THE_TOKEN} portion of: http://localhost/callback/?code={GET_THE_TOKEN}

  • Create a string combining {SPOTIFY_CLIENT_ID}:{SPOTIFY_CLIENT_SECRET} (e.g. 5n7o4v5a3t7o5r2e3m1:5a8n7d3r4e2w5n8o2v3a7c5) and encode into Base64.

  • Then run a curl command:

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Basic {YOUR_BASE64}" -d "grant_type=authorization_code&redirect_uri=http://localhost/callback/&code={YOUR_TOKEN}" https://accounts.spotify.com/api/token
  • Then save the Refresh token

Configure Vercel Application

  • Fork this Spotify Status

  • Register on Vercel

  • Create project linked to your forked respository
    Note: set Framework Preset to 'Other'

    Vercel

  • Add Project Name and Environment Variables: Warning: Avoid white spaces!!

    • SPOTIFY_REFRESH_TOKEN
    • SPOTIFY_CLIENT_ID
    • SPOTIFY_SECRET_ID
    • SPOTIFY_BAR_COLOR
      • Hex Color
    • SPOTIFY_BADGE_COLOR
      • Hex Color

    Vercel

  • Deploy

Put this in your README.md

Small

s4nx Playing Now

[<img src="https://{DOMAIN_OF_YOUR_VERCEL_APP}/api/run-spotify-status" alt="Your alt what" width="350" />](LINK_TO_YOUR_ACCOUNT)

Medium

s4nx Playing Now

[<img src="https://{DOMAIN_OF_YOUR_VERCEL_APP}/api/run-spotify-status" alt="Your alt what" width="400" />](LINK_TO_YOUR_ACCOUNT)

Large

s4nx Playing Now

[<img src="https://{DOMAIN_OF_YOUR_VERCEL_APP}/api/run-spotify-status" alt="Your alt what" width="500" />](LINK_TO_YOUR_ACCOUNT)

Contribution

Feel Free to contribute, PR are the most welcome :)

License

Copyright (c) 2020 Sandro Cagara | Spotify Status

readme-spotify-status's People

Contributors

sndrjhlncgr avatar sandrojhulianocagara avatar yosm1 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.