Takes a POST request, fetches the currently playing SWR3 song, and posts the song to a Slack channel.
The POST request is sent by a BIG red button in the living room, running button.py
on a C.H.I.P. or Raspberry Pi.
curl -X POST http://homer@localhost:9292/songs
where homer
is a basic-auth user that is @-mentioned in the message. The password is ignored.
see deployment/README.markdown
$ eval "$(docker-machine env production)"
$ docker-compose up -d
Alternatively, the image can also be built on a staging server and then promoted to the production server. The stages should be defined in docker-stages.yml
.
$ eval "$(docker-machine env staging)"
# To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
$ docker-compose build
$ bundle exec rake docker:promote
Afterwards the image just has to be run:
$ eval "$(docker-machine env production)"
# To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
$ docker-compose up -d
In order to have WEBrick listen on all interfaces:
be rackup -o 0.0.0.0
- Set the slack picture to the thumbnail included in the SWR3 json
- Set the slack message's URL to the one included in the SWR3 json, so that we point to the artist and song
- Add an 'love it too' button so that the Slack user gets it registered, too
- Detect the nearest Bluetooth device in order to find who's nearby