• Stars
    star
    122
  • Rank 292,031 (Top 6 %)
  • Language
    Shell
  • Created almost 9 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🎧 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 Repositories

1

cardboard-admin-archive

Rails 4 CMS
Ruby
65
star
2

fraqture

An interactive digital art project built with Clojure and Arduino
Clojure
17
star
3

boxcar-generator-archive

A tool for generating Rails applications with the best practices of the Smashing Boxes team.
Ruby
16
star
4

jquery.annotate

A jQuery plugin for adding inline commenting/annotations to any website.
JavaScript
10
star
5

taperole

🕹 Application Server Provisioning and Deployment with Ansible
Ruby
9
star
6

learning-generative-art

Neural Networks + Generative Art
JavaScript
8
star
7

moogfest-2017

Code and instructions for building a $20 synthesizer using our Moogfest-2017 kit
C++
7
star
8

android-analytics

A library to simplify integrating Google Analytics into your Android application
Java
5
star
9

sb-engineering-guides

Smashing Boxes' Processes and Best Practices
5
star
10

sb_app_generator

Rails app generator with just the basics
Ruby
4
star
11

splitdropbutton

A simple, easily stylable, split button dropdown jQuery plugin
JavaScript
4
star
12

box_cutter

Box Cutter is inspired by thoughtbot's Suspenders. Just like Suspenders says, use Box Cutter if you're in a rush to build something amazing; don't use it if you like missing deadlines.
Ruby
4
star
13

web-boilerplate

A template for new front-end projects.
JavaScript
3
star
14

code_challenge_android

A coding challenge for potential Android hires to complete
Java
3
star
15

boxcar

Smashing Boxes' Ruby on Rails application template
Ruby
2
star
16

cardboard

Ruby
2
star
17

BuildNumberLabel

Put a build number on it! (iOS)
Swift
2
star
18

stagehand

client library for Personas (user management) service
Ruby
2
star
19

coffeebot

A Particle powered IoT timer that makes sure you don't settle for cold coffee
Eagle
2
star
20

landing-page-builder

landing-page-builder
JavaScript
1
star
21

dotfiles

Get your configs right
1
star
22

brad-stuff

some stuff from brad
JavaScript
1
star
23

eslint-config-smashing-boxes

JavaScript
1
star
24

smashing_docs

Ruby
1
star
25

git-setup

a nice default setup for git and bash
Shell
1
star
26

SeleniumToolkit

SeleniumToolkit is a Java library that allows for faster development of functional automation testing scripts with Selenium.
Java
1
star
27

smashing-dev-tool

CoffeeScript
1
star
28

activerecord-diff

Simple ActiveRecord diff functionality
Ruby
1
star
29

todo

Example Vagrant + Chef Solo app
Ruby
1
star
30

pullme

Ruby shell script used to issue pull requests on Github with existing issues
Ruby
1
star
31

jquery.cloudbar

Generates a sidebar based upon a custom taxonomy and provides scrolling
JavaScript
1
star
32

door_opener

Open our door
Ruby
1
star
33

surelock

Android fingerprint authentication made easy. Elementary, my dear Watson.
Java
1
star
34

TicketPile

./gradlew run & open https://localhost:9443/swagger-ui.html #(refresh browser till backend boots, then copy auth token in)
Kotlin
1
star
35

labs-timetracker

JavaScript
1
star
36

Scrum

Scrum is an empirical Agile project management framework used to deliver increments of high value to the customer iteratively.
HTML
1
star
37

personas

OAuth2 provider/user management system
Ruby
1
star
38

control

Smashing Boxes Control Panel
JavaScript
1
star
39

jquery.will_autoscroll

An autoscroll plugin designed with the will_paginate plugin in mind.
JavaScript
1
star
40

persona

A basic sinatra framework for rapid prototyping.
Ruby
1
star