GithubHelp home page GithubHelp logo

isabella232 / totebot2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nprapps/totebot2

0.0 0.0 0.0 1.97 MB

Everything is better in the new building, even the totebot.

Python 2.47% Shell 0.27% CoffeeScript 96.44% Batchfile 0.12% JavaScript 0.70%

totebot2's Introduction

Totebot

This project is no longer maintained. We have updated javascript dependencies due to github security warning but have not tested the actual impact of that measure on the app functionality.

Derived from the ubiquitous NPR tote bag, Totebot2 follows our conversations on HipChat and provides us with some ambient awareness. Also, humor.

Additional thanks to the Los Angeles Times Data Desk and their copyboy project.

Some light reading

Initial setup

  • Create a new HipChat account for your bot to use. Stay signed in to the account - we'll need to access its account settings later.

  • Add the proper environment variables to your .bash_profile (Stored in our team environment variables file โ€” ask David, Tyler or Chris). These unprefixed versions of the hubot environment variables will be used for local development.

export [email protected]
export HUBOT_HIPCHAT_PASSWORD=password
export [email protected]
export HUBOT_LOG_LEVEL=debug
  • Add prefixed versions of the environment variables to .bash_profile (Also stored in our team environment variables file). The prefixed versions are used by the fab [target] render_confs command to deploy secrets to the server and are necessary in order to run multiple hubots without sharing API keys.
export [email protected]
export TOTEBOT2_HUBOT_HIPCHAT_PASSWORD=password
export [email protected]
export TOTEBOT2_HUBOT_LOG_LEVEL=debug
  • In your main projects folder (e.g., ~/src/), clone this repo and set up a virtual environment
cd ~/src/
git clone [email protected]:nprapps/totebot2.git
cd totebot2
mkvirtualenv totebot2
  • Install required libraries
pip install -r requirements.txt
npm install
brew install icu4c
brew link icu4c
brew install redis
ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
  • Install hubot from npm, if you don't already have it:
npm install --global hubot
  • Switch to the new hubot directory (it might be /usr/local/lib/node_modules/hubot) and install dependencies:
cd <above path>
npm install

Local development

  • Start the totebot virtualenv
cd ~/src/totebot2
workon totebot2
  • Start Hubot
hubot

Hubot will run through the scripts in your scripts folder and let you know about any errors or warnings. Then it will appear to stall. Press the enter key to bring up the Hubot > prompt.

If you're testing a command to be directed specifically at Totebot (for example, @totebot next train), you will want to address @hubot at the prompt (@hubot next train).

Deployment

  • Make sure you've exported prefixed versions of our environment variables (see "Initial Setup")

  • Commit your new scripts to the repo.

  • Add any necessary environment variables to app_config.py and totebot2.conf

  • Deploy environment variables to the server (if changed)

fab utils deploy_confs
  • Deploy scripts.
fab utils master deploy

We don't have a staging environment yet.

  • To test your script in HipChat, start a conversation with Totebot (like you would another person) and type in your commands.

Maintenance

  • Sometimes, Totebot goes away. :( To restart:
fab utils restart_init

totebot2's People

Contributors

alykat avatar brianboyer avatar dannydb avatar jeremyjbowers avatar newsroomdev avatar onyxfish avatar palewire avatar ryanpitts avatar tylerfisher avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.