ProductPromotion
Logo

Ruby

made by https://0x3d.site

GitHub - smashingboxes/maestro: :headphones: A Slack-Powered music bot for Spotify
:headphones: A Slack-Powered music bot for Spotify - smashingboxes/maestro
Visit Site

GitHub - smashingboxes/maestro: :headphones: A Slack-Powered music bot for Spotify

GitHub - smashingboxes/maestro: :headphones: A Slack-Powered music bot for Spotify

Maestro

A Slack-Powered music bot for Spotify, using Sinatra and shpotify.

Getting Started

The first thing you'll need to run Maestro is a computer to run it from. It'll need to be running OSX, with homebrew installed. It'll also need Ruby, which comes pre-installed with OSX, so you should be good there. Lastly, but most importantly, this computer is the one that will be playing the music, so it'll either need good speakers, or a headphone jack to plug a sound system into.

Once you've got a computer to run it on, you can install Maestro by running the following commands in a terminal:

brew install shpotify

git clone https://github.com/smashingboxes/maestro.git
cd maestro
bundle install

Connecting to Spotify's api

shpotify needs to connect to Spotify’s API in order to find music by name. It is very likely you want this feature!

To get this to work, you first need to sign up (or into) Spotify’s developer site and [create an Application][spotify-dev]. Once you’ve done so, you can find its Client ID and Client Secret values and enter them into your shpotify config file at ${HOME}/.shpotify.cfg.

Be sure to quote your values and don’t add any extra spaces. When done, it should look like the following (but with your own values):

CLIENT_ID="abc01de2fghijk345lmnop"
CLIENT_SECRET="qr6stu789vwxyz"

Usage

ruby app.rb

This will start up Maestro on port 4567. To use it with Slack, you'll want to configure an external URL (see "Obtaining an external URL" below), and set up a slash command (see "Creating a slash command" below).

Once that's done, you can interact with it via any command shpotify supports. Here are the most common commands:

/maestro play <song name>
/maestro next
/maestro vol up
/maestro vol down
/maestro status

Configuring Slack

Obtaining an external URL

There are many ways to get an external URL or static IP. The easiest is to use ngrok:

brew cask install ngrok
ngrok http 4567

In the output, ngrok will provide you with an external url such as http://71ca42f4.ngrok.io, you'll need that for the next section.

NOTE: If ngrok gets restarted (during a computer restart, for example), a new URL will be generated. You'll need to update your slash command (created in the next section) with the new one.

Creating a slash command

To create a slash command in Slack, go to https://slack.com/apps/A0F82E8CA-slash-commands, click "Add Configuration", and fill in the following settings:

  • Command: "/maestro"
  • URL: Your external URL (from previous section), followed by /maestro. So, for example, if your ngrok url is http://71ca42f4.ngrok.io, you'd enter http://71ca42f4.ngrok.io/maestro
  • Method: POST
  • Customize Name: Maestro
  • Customize Icon: Any icon you'd like. Feel free to use ours
  • Autocomplete help text:

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory