Lazy deejays won first prize and we wanted to share the code that made it all possible. Since we had to hack this up in a single day there's no QA or testing
WTF is lazy deejays?
You know how parties nowadays always have like a laptop with 6 tabs of youtube open where everybody wants to play his song? Don't you just hate it when somebody with his drink comes in and ignores all that, closes the other tabs and plays his stupid song?
Meet lazy deejays. The DJ just opens up a website with a playlist. People can now request new songs through the bot. The songs are queued to the playlist automatically. easy cheesy.
If you test the bot on localhost you need a tunnel. You can use ngrok (simplest solution) or use your own server e.g.
ssh -R 80:localhost:3000 email@example.com
With ngrok you'll have a nice https tunnel that you can use to setup the webhook in messenger.
clone the repo
Install redis & libsqlite3-dev:
sudo apt-get install redis-server libsqlite3-dev
Make sure you're running ruby >=2.2. Do a bundle install
config/initializers/messenger.rband put in your messenger tokens. Use this tutorial to create your page, bot and generate webhooks.
config/initializers/yt.rband put in your Google APIs Youtube API browser key. Follow this tutorial to get a key. Make sure the API Key is a browser one and not a server one.
rails sto start the server
http://127.0.0.1:3000/messenger/subscribeto subscribe the bot. You can now text your bot :)
http://127.0.0.1:3000/and party hard!
Apache 2.0. Please beware that you are not allowed to use the names "Lazy Deejay", "Lazy Deejays" or "Lazy DJs".
Copyright 2016 Todor Lazov, David Mann, David Peherstorfer, Larisa Stanescu
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.