Spotify Auth and Replies

in #utopian-io8 years ago (edited)

New Features

Spotify Authentication

This PR finally implements the entire spotify oauth process using the Authorization Code method. It requires that you set three environment variables

export SPOTIFY_AUTH={{your spotify authorization code}}
export SPOTIFY_CLIENT_ID={{your spotify client id}}
export SPOTIFY_CLIENT_SECRET={{your spotify client secret}}

The processes uses these variables in a request sent to spotify which returns an access_token and a refresh_token. The access_token is used on subsequent requests to get information from the spotify API, while the refresh_token is used after 60 minutes to generate a new access_token.

image

Once we have access to spotify, we can search for songs and manipulate playlists. This lets us add songs directly to the weekly playlist, and keep track of who chooses what song. Replies are parsed and used to search spotify's database for the track. If found, the bot will reply and add that song to the weekly playlist, automating much of the process.

Now Playing

image.png
Check out the #nowplaying community and bot in action here



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Hey @amosbastian, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!

Hey @walnut1 I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.04
TRX 0.32
JST 0.100
BTC 65019.26
ETH 1917.65
USDT 1.00
SBD 0.39