Skip to content

adamakhtar/slack_dj

Repository files navigation

slack_dj

Heads up! This project is not affiliated with the company who made Slack in any way. It's just a fun little project I wrote.

About

SlackDJ gives you and your coworkers your own shared music player powered by Slack, Youtube and Websockets. Members of your Slack group can add videos to the players queue in slack and view them via your slackdj's hoempage.

Whether you are all in the same office or all working remotely the apps player will keep everyone in sync with what is playing.

Team members are free to add as many songs as they like with a couple of handy slack commands:

add a youtube video via its url /dj play https://www.youtube.com/watch?v=dQw4w9WgXcQ

add a video by its name /dj find michael jackson thriller

See below for more commands

Setup

The app uses the YouTube api to search for videos so you will need to get an api key from the Google Developer's Console. Its pretty self explanatory and only takes a couple of clicks. Full instructions if needed can be found here

Once you have the key then run the following

# clone the repo 
git clone https://github.com/adamakhtar/slack_dj.git

# cd into the repo and create a heroku app 
heroku create my_app_name # note the apps url

# get a free redis instance 
heroku addons:create redistogo 

# configure the heroku app by running 
heroku config:set APP_DOMAIN=my_app_name.herokuapp.com  
*do not include the http part*

heroku config:set ACTION_CABLE_ALLOWED_ORIGIN=http://my_app_name.herokuapp.com 
*DO inlude the http part - http NOT https*

heroku config:set YOUTUBE_ACCESS_TOKEN=the_api_key_you_got_earlier

# push the project to heroku and migrate
git push heroku master
heroku run rake db:migrate

Finally head to your slack team settings and go to

Configure Apps -> Custom Integrations -> Slash Commands

Add a new configuration with the following settings:

Command : /dj
Webhook URL : https://your_app_name.herokuapp.com/slack_webhooks don't forget the slack_webhooks part
Method : POST

The other settings can be ignored. Once saved you are good to go. Try adding a video and visiting your apps homepage.

Commands

You can run the following commands in Slack to control the player.

/dj help 
View all commands 

Play a video via its youtube url
/dj play http://youtube.com....

Find a video by artist and name and play it
/dj find michael jackson thriller

Skip the currently playing video
/dj skip

Display previously played videos
/dj history

Development

bin/setup

During development you will want to simulate incoming slack webhooks. You can do this by visiting your_app_name.herokuapp.com/test

About

A slack powered music player for your team

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published