edgi-govdata-archiving / edgi-hubot-halpy

Heroku-backed chatbot-friend who lives in EDGI Slack
https://edgi-hubot.herokuapp.com/
3 stars 0 forks source link
chatbot edgi-bot heroku hubot

Code of Conduct

Halpy

NOTE: Halpy is not actively maintained. It needs major updates to Hubot and other dependencies, and EDGI members have not had time to keep up with it. If you’re interested in helping out by maintaining Halpy, let us know on the #tools_talk channel of the EDGI Slack.

Halpy is a chat bot used by the Environmental Data & Governance Initiative (EDGI) to assist us in our Slack chat.

It is built on the Hubot framework and deployed on the Heroku platform and lives here: edgi-hubot.herokuapp.com

Table of Contents

Deployment

Running Halpy Locally

You can start Halpy locally by running this in your terminal:

npm start

(Some plugins will not behave as expected unless the environment variables they rely upon have been set.)

You'll see some start up output and a prompt:

[Sat Feb 28 2015 12:38:27 GMT+0000 (GMT)] INFO Using default redis on localhost:6379
halpy>

Then you can interact with Halpy by typing halpy help.

halpy> halpy help
halpy help - Displays all of the help commands that halpy knows about.
...

It will also be serving a small website at: localhost:8585

Configuration

A few scripts (including some installed by default) require environment variables to be set as a simple form of configuration.

Each script should have a commented header which contains a "Configuration" section that explains which values it requires to be placed in which variable. When you have lots of scripts installed this process can be quite labour intensive. The following shell command can be used as a stop gap until an easier way to do this has been implemented.

grep -o 'hubot-[a-z0-9_-]\+' external-scripts.json | \
  xargs -n1 -I {} sh -c 'sed -n "/^# Configuration/,/^#$/ s/^/{} /p" \
      $(find node_modules/{}/ -name "*.coffee")' | \
    awk -F '#' '{ printf "%-25s %s\n", $1, $2 }'

How to set environment variables will be specific to your operating system. Rather than recreate the various methods and best practices in achieving this, it's suggested that you search for a dedicated guide focused on your OS.

Scripting

An example script is included at scripts/example.coffee, so check it out to get started, along with the Scripting Guide.

For many common tasks, there's a good chance someone has already one to do just the thing.

Notes