Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nicksergeant/slacktapped

🍺 An Elixir app to post Untappd checkins to Slack.
https://github.com/nicksergeant/slacktapped

Last synced: 3 months ago
JSON representation

🍺 An Elixir app to post Untappd checkins to Slack.

Awesome Lists containing this project

README

        

# Slacktapped [![CircleCI](https://circleci.com/gh/nicksergeant/slacktapped.svg?style=svg)](https://circleci.com/gh/nicksergeant/slacktapped)

Slacktapped is an Elixir app to post Untappd activity to Slack.

Once installed, this bot will post checkins, badges, and comments to a Slack
channel.

It can also (with additional configuration)
respond to Slack slash commands and allow users to search for beers on Untappd.

The source code is available on GitHub at [https://github.com/nicksergeant/slacktapped](https://github.com/nicksergeant/slacktapped).

Online documentation is available at [slacktapped.com](http://slacktapped.com).

## Setup

1. Apply for an Untappd API application.
Make sure you set a Callback URL for the application (any valid URL).
2. Create an incoming webhook
and point it to the channel of your choosing in your Slack team.
3. Create a new Untappd user. This user will be a standalone user that the bot
will authenticate as.
4. For any people whose Untappd activity you want this bot to post, have that
person "friend" the Untappd user created in step 3, and then accept the
friendship on Untappd.
5. Obtain or deploy a Redis
instance. Redis is used to keep track of activity that has been posted to
Slack.
6. With your Untappd API credentials, authenticate as your user using the
"Client Side Authentication" instructions here.
Use the provided Callback URL you specified in step 1. Make note of the
returned `access_token` in the URL. Currently Untappd does not expire access
tokens retrieved in this manner, but we may implement proper OAuth support
for Slacktapped in the future.
7. Clone this repo and deploy to Heroku
or Dokku, by following the
instructions below. You should also be able to deploy to any system that
supports building applications via buildpacks.

## Deployment

1. Do a `git push` to Heroku or your Dokku server.
2. `heroku buildpacks:set hashnuke/elixir`
3. Set your environment variables:

```
INSTANCE_NAME='' # Unique name for this Slacktapped instance.
REDIS_URI='' # URI for your Redis isntance.
SLACK_WEBHOOK_URL='' # Your Slack incoming webhook URL.
UNTAPPD_ACCESS_TOKEN='' # Token obtained via auth request above.
UNTAPPD_CLIENT_ID='' # Your Untappd client ID.
UNTAPPD_CLIENT_SECRET='' # Your Untappd client secret.
```

Once you've deployed with the proper credentials, you should start seeing logs
for your application indicating that the processor is running. It will poll
Untappd every 60 seconds for new activity:

```
[Processor] Running...
[Processor] Done.
```

With any luck, you'll see Untappd activity in your Slack channel:

![http://i.nick.sg/45afb435b99b478eb4dade42567072af.png](http://i.nick.sg/45afb435b99b478eb4dade42567072af.png)

## Slash Commands

In addition to polling the Untappd API for activity, this bot also boots a web
server that can act as a Slack Slash Command endpoint.

Once installed, users can use the slash command to search for beers on Untappd,
like this:

```
/untappd dogfish 90
```

![http://i.nick.sg/73b251f371db440fb9872f58f044964d.png](http://i.nick.sg/73b251f371db440fb9872f58f044964d.png)

By default, the slash command will respond privately to the user. It will
respond publicly to the channel by appending `-public` to the command, like so:

```
/untappd dogfish 90 -public
```

**Installation:**

1. Create a slash command for
your Slack team.
2. Ensure that your bot is running under an HTTPS endpoint (Slack requires this).
3. Set the URL for the slash command to `https:///search`.
4. Set the environment variable for the slash command token:

```
UNTAPPD_SLASH_CMD_TOKEN=''
```

## Options

Badges can get a bit noisy when you're only interested in seeing checkins and
comments, so you can disable badge posts by setting the following environment
variable:

```
IGNORE_BADGES='true'
```

To disable comments:

```
IGNORE_COMMENTS='true'
```

## Support

If you need help deploying or have an idea for a feature, create an issue.