datamade/databot

Name: databot

Owner: datamade

Description: :crystal_ball: Slackbot for datamade

Created: 2015-05-08 13:42:26.0

Updated: 2015-10-21 22:12:44.0

Pushed: 2015-10-22 13:55:49.0

Homepage:

Size: 144

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

DataBot

A Slack bot for DataMade.

Run it locally

You need an Auth token for the team that you're wanting to post amazing things into. For the lunch ideas, you'll also need various Yelp tokens.

To get an auth token

  1. Go here: https://api.slack.com/web, scroll down to the bottom and find the list of teams that you belong to.
  2. Click the button to issue a token for the team that you want to put your bot in and grab the token.

Getting Yelp tokens

  1. Go here and get a Consumer Key, Consumer Secret, Token and Token Secret for the Yelp API.

Run the app

This app was developed using Python 3.4.3 but I'm pretty sure it'll work in Python 2.7.x as well. Either way, get yourself a virtual enviromnent and install the requirements:

ing vanilla virtualenv 
rtualenv venv
urce venv/bin/activate
p install -r requirements.txt

ing virtualenvwrapper
virtualenv bot
p install -r requirements.txt

In order for the app to run, it needs the various keys and tokens that you just got set as environmental variables. So, before you can run it, you'll need to set those:

port SLACK_AUTH_TOKEN='theauthtoken'
port YELP_CONSUMER_KEY='key'
port YELP_CONSUMER_SECRET='secret'
port YELP_TOKEN='token'
port YELP_TOKEN_SECRET='token_secret'

To make those stick around between terminal sessions, you can add those lines into your .bashrc file (or similar) and source it:

m ~/.bashrc # add those to export statements
urce ~/.bashrc

Now that all that is setup, you can run the app by doing python app.py with your virtualenv activated.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.