Pinned grabs the pinned messages from Slack and turns them into a multiple choice quiz where your objective is to guess the original author of the pin! πΌ
By far the easiest way to take Pinned for a spin on your local machine is by using Docker. Simply pull and run the image, pass in your Slack Token open your browser.
To build from local Dockerfile, run:
docker build . -t pinnedPull the latest version off of DockerHub
docker pull tiemenwaterreus/pinnedRun the image
docker run --rm -d \
-e "SLACK_TOKEN=<YOUR-SLACK-TOKEN-HERE>" \
-e "SLACK_CHANNEL=general" \
-p 4000:4000 \
--name pinned \
-t tiemenwaterreus/pinned:latestNote: Make sure to replace the <YOUR-SLACK-TOKEN-HERE> in the environment variable SLACK_TOKEN with your own token.
Read how to obtain a legacy Slack token over here.
Other environment variables include:
| Variable | Description |
|---|---|
| SLACK_TOKEN | Your Slack Token |
| SLACK_CHANNEL | Channel from which we read the Pins. Default: General |
| NUM_CHALLENGES | How many pins to guess? Default: 5 |
| NUM_CHOICES | How many possible authors? Default: 4 |
| SERVER_PORT | What port is the Server listening on? Default: 4000 |
If you pass the_office as SLACK_TOKEN, Pinned will actually run demo mode and present quotes from The Office (US) instead of fetching pins from slack. π€·β
- Git
- Golang 1.11.x
- Node (10.x.x)
- Foreman (Or other Procfile runner)
git pull github.com/tmw/pinned & cd pinnedIn the pinned directory, you'll find tow directories. frontend and backend. backend contains all the Go code that communicates with the Slack API and exposes a small API to interface with the front-end.
The frontend folder contains all the front-end code and is built using create-react-app.
cd frontend
yarn startcreate-react-app uses Yarn to build and watch the front-end directory and serves it with live-reload using a small development server.
cd backend
go get
go run main.goEver since Go 1.11 a Go project doesn't neccecerily have to live within the $GOPATH anymore. A simple go get and go run should do the trick here.
If you're lazy enough and installed Foreman, just run:
foreman startnow https://github.com/tmw/pinned -e SLACK_TOKEN=<your_legacy_slack_token>