Giter VIP home page Giter VIP logo

onejukebox's Introduction

OneJukebox

Spotify playlist collaboration through Slack. Based on SlackBox.

Simply create a Slash Command, such as /jukebox, which accepts a track name (also the artist too for a less fuzzy search) to add to a pre-defined Spotify playlist:

/jukebox Bell Biv DeVoe โ€“ Poison

And/Or add it as a listener on your slack channel; paste YouTube/Spotify links to get your song added to the shared playlist!

Deploy

Installation

Slash Command setup

First you'll want to create your Slack Slash Command, which you can do by going to your Slash Commands page.

During setup, have your slash command submit a POST to your app's /store endpoint, e.g. https://app-name.herokuapp.com/store.

Make a note of the Token, as you'll need it later to help guard against cross-site request forgery.

Slack Channel Listener setup

  1. Head to Slack > CustomIntegrations > Outgoing Webhooks and add a new configuration. Set the Channel to listen to, and add your app's /parse endpoint (e.g. https://app-name.herokuapp.com/parse) to URL(s). Make a note of the Token, as you'll need it later to help guard against cross-site request forgery.
  2. Head to Slack > CustomIntegrations > Incoming Webhooks and add a new configuration. Note the Webhook URL for the settings and customize the look of the incoming message bot to your preference.

Spotify

Head over to Spotify's Developer Site and create a new Application. Make sure you add whatever slackbox's callback URI as a valid callback URI. If you're running locally, this will be /callback endpoint (e.g. on Heroku https://app-name.herokuapp.com/callback).

Make a note of the key, secret and callback URI too, as you'll need these later as well.

Also, don't forget to make a playlist. If you do this through Spotify's web interface then the playlist identifier will be the last segment of the URI - make a note of this too! If there's a better way of finding this out, we're all ears. If you do this through the app, right-click the playlist to get it's web URL and again, you need the last segment of the URI.

Environment variables

Once you've cloned OneJukeBox or hit the "Deploy with Heroku" button you'll need to setup the following environment variables. These can either be stored in a .env file or set up as config variables in Heroku.

  • SLACK_TOKEN - The token from Slack's Slash Command.
  • SLACK_TOKEN2 - The token from Slack's Outgoing Webhook.
  • SLACK_INCOMING_HOOK_URL - The WebhookURL from Slack's Incoming Webhooks.
  • SPOTIFY_KEY - Your Spotify application key (a.k.a Client ID).
  • SPOTIFY_SECRET - Your Spotify application secret (a.k.a Client Secret).
  • SPOTIFY_USERNAME - Your Spotify username.
  • SPOTIFY_PLAYLIST_ID - Your playlist identifier.
  • SPOTIFY_REDIRECT_URI - URI to redirect to once your user has allowed the application's permissions.

Authentication

Visit your OneJukeBox's /authorise end to authenticate yourself with Spotify and you should be all set!

onejukebox's People

Contributors

pforpallav avatar

Stargazers

 avatar

Watchers

 avatar  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.