Slash command for slack tube statuses
Clone or download
#9 Compare This branch is 71 commits ahead, 3 commits behind oskanberg:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
mocks
present
test-data
.gitignore
.travis.yml
Dockerfile
Gopkg.lock
Gopkg.toml
README.md
circle.yml
commands.go
deploy_prod.sh
http_handlers.go
http_handlers_test.go
main.go
mkbin.sh
routes.go
slack_handlers.go
slack_handlers_test.go
slack_request.go
slack_response.go
tfl-service.go
tfl-service_test.go
token_repository.go
user_repository.go

README.md

Build: CircleCI Coverage Status

Build & Run

Run locally:

Pre-requisite:

Run:

go run *.go

In alternative: go build && ./slack-tube-service

Access:

Just connect to localhost:1123

Run within Docker container

Pre-requisite:

Build:

docker build -t slack-tube-service .

Run:

docker run -it --rm --name slack-tube-service -p 1123:1123 slack-tube-service

Access:

If docker daemon is running on localhost

Just connect to localhost:1123

If using docker machine

Find out your IP: docker-machine ip `docker-machine active` Connect to that IP, port 1123.

APIs

  • GET /api/tubestatus/ -> retrieve status for all the lines
  • GET /api/tubestatus/{line} -> retrieve status for a specific line (e.g. GET /api/tubestatus/Bakerloo)
  • POST /api/slack/tubestatus -> retrieve status for all the lines with slack-friendly formatting (uses auth token to validate slack client)
  • PUT /api/slack/token/{token} -> adds a slack token to the authorised list
  • DELETE /api/slack/token/{token} -> removes a slack token from the authorised list

This is what the integration looks like:

Slack Integration

#What if I just want to use it? This project is still experimental but it works, and if you want to try this integration for free just drop me an email and I'll get in touch.