Giter VIP home page Giter VIP logo

hubot-badger's Introduction

Hubot

This is a version of GitHub's Campfire bot, hubot. He's pretty cool.

This version is designed to be deployed on Heroku. This README was generated for you by hubot to help get you started. Definitely update and improve to talk about your own instance, how to use and deploy, what functionality he has, etc!

Testing

Running Hubot Locally

You can test your hubot by running the following.

% bin/hubot

You'll see some start up output about where your scripts come from and a prompt.

[Sun, 04 Dec 2011 18:41:11 GMT] INFO Loading adapter shell
[Sun, 04 Dec 2011 18:41:11 GMT] INFO Loading scripts from /home/tomb/Development/hubot/scripts
[Sun, 04 Dec 2011 18:41:11 GMT] INFO Loading scripts from /home/tomb/Development/hubot/src/scripts
Hubot>

Then you can interact with hubot by typing hubot help.

Hubot> hubot help

Hubot> animate me <query> - The same thing as `image me`, except adds a few
convert me <expression> to <units> - Convert expression to given units.
help - Displays all of the help commands that Hubot knows about.
...

Running Unit Tests

You can run mocha unit tests by running the following.

% npm test

To create a new test for a script (e.g. scripts/myscript.coffee), create a spec file.

% touch tests/myscript.spec.coffee

Refer to this helpful guide as well as other tests in the tests directory to learn more about writing unit tests for hubot scripts.

Scripting

Take a look at the scripts in the ./scripts folder for examples. Delete any scripts you think are useless or boring. Add whatever functionality you want hubot to have. Read up on what you can do with hubot in the Scripting Guide.

Redis Persistence

If you are going to use the redis-brain.coffee script from hubot-scripts (strongly suggested), you will need to add the Redis to Go addon on Heroku which requires a verified account or you can create an account at Redis to Go and manually set the REDISTOGO_URL variable.

% heroku config:add REDISTOGO_URL="..."

If you don't require any persistence feel free to remove the redis-brain.coffee from hubot-scripts.json and you don't need to worry about redis at all.

Adapters

Adapters are the interface to the service you want your hubot to run on. This can be something like Campfire or IRC. There are a number of third party adapters that the community have contributed. Check the hubot wiki for the available ones.

If you would like to run a non-Campfire or shell adapter you will need to add the adapter package as a dependency to the package.json file in the dependencies section.

Once you've added the dependency and run npm install to install it you can then run hubot with the adapter.

% bin/hubot -a <adapter>

Where <adapter> is the name of your adapter without the hubot- prefix.

hubot-scripts

There will inevitably be functionality that everyone will want. Instead of adding it to hubot itself, you can submit pull requests to hubot-scripts.

To enable scripts from the hubot-scripts package, add the script name with extension as a double quoted string to the hubot-scripts.json file in this repo.

external-scripts

Tired of waiting for your script to be merged into hubot-scripts? Want to maintain the repository and package yourself? Then this added functionality maybe for you!

Hubot is now able to load scripts from third-party npm packages! To enable this functionality you can follow the following steps.

  1. Add the packages as dependencies into your package.json
  2. npm install to make sure those packages are installed

To enable third-party scripts that you've added you will need to add the package name as a double quoted string to the external-scripts.json file in this repo.

Deployment

% heroku create --stack cedar
% git push heroku master
% heroku ps:scale app=1

If your Heroku account has been verified you can run the following to enable and add the Redis to Go addon to your app.

% heroku addons:add redistogo:nano

If you run into any problems, checkout Heroku's docs.

You'll need to edit the Procfile to set the name of your hubot.

More detailed documentation can be found on the deploying hubot onto Heroku wiki page.

Deploying to UNIX or Windows

If you would like to deploy to either a UNIX operating system or Windows. Please check out the deploying hubot onto UNIX and deploying hubot onto Windows wiki pages.

Campfire Variables

If you are using the Campfire adapter you will need to set some environment variables. Refer to the documentation for other adapters and the configuraiton of those, links to the adapters can be found on the hubot wiki.

Create a separate Campfire user for your bot and get their token from the web UI.

% heroku config:add HUBOT_CAMPFIRE_TOKEN="..."

Get the numeric IDs of the rooms you want the bot to join, comma delimited. If you want the bot to connect to https://mysubdomain.campfirenow.com/room/42 and https://mysubdomain.campfirenow.com/room/1024 then you'd add it like this:

% heroku config:add HUBOT_CAMPFIRE_ROOMS="42,1024"

Add the subdomain hubot should connect to. If you web URL looks like http://mysubdomain.campfirenow.com then you'd add it like this:

% heroku config:add HUBOT_CAMPFIRE_ACCOUNT="mysubdomain"

Restart the bot

You may want to get comfortable with heroku logs and heroku restart if you're having issues.

hubot-badger's People

Contributors

andrewgiang avatar cdpetersen avatar chelseybaker avatar crebma avatar ctrevarthen avatar davidklaw avatar dependabot[bot] avatar dpoggi avatar dtrenz avatar elyselturner avatar ghost-code avatar ickybodclay avatar jasonstolaruk avatar jsibbold avatar juanbrujo avatar kc8nod avatar kyleofori avatar laurenmalatesta avatar macklinu avatar maschall avatar mbsnyder avatar ndh avatar northofnormal avatar nwest avatar slaunchaman avatar sleepynate avatar stkent avatar tmay avatar whinchman avatar yramocan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hubot-badger's Issues

[tigers] remove hardcoded schedule

I am working on a Detroit Tigers API, where the tigers.coffee script can fetch the next 7 days worth of games from the API instead of having to hardcode and maintain the schedule within the script every year. I will update the script once the API is up and running on Heroku. ⚾️

Hubot using invalid HipChat API token

In emoticons.coffee:

hipchatter = new Hipchatter(process.env.HIPCHAT_API_V2_KEY)

We need to update that key. I believe it is using my personal key, which I changed after accidentally committing it to a personal GitHub repo.

If anyone can update Heroku this week to fix it, that would be a dream. Otherwise, I will look into it later this week.

[distributed-list] ERROR TypeError: Cannot call method 'toString' of null

2015-06-24T18:53:11.962037+00:00 app[web.1]: [Wed Jun 24 2015 18:53:11 GMT+0000 (UTC)] ERROR TypeError: Cannot call method 'toString' of null
2015-06-24T18:53:11.962043+00:00 app[web.1]:   at getUserNamesForList (/app/scripts/distributed-list.coffee:88:3, <js>:92:17)
2015-06-24T18:53:11.962045+00:00 app[web.1]:   at TextListener.callback (/app/scripts/distributed-list.coffee:56:7, <js>:46:17)
2015-06-24T18:53:11.962046+00:00 app[web.1]:   at TextListener.Listener.call (/app/node_modules/hubot/src/listener.coffee:27:7, <js>:23:14)
2015-06-24T18:53:11.962048+00:00 app[web.1]:   at Robot.receive (/app/node_modules/hubot/src/robot.coffee:197:9, <js>:142:33)
2015-06-24T18:53:11.962049+00:00 app[web.1]:   at HipChat.Adapter.receive (/app/node_modules/hubot/src/adapter.coffee:66:5, <js>:47:25)
2015-06-24T18:53:11.962051+00:00 app[web.1]:   at /app/node_modules/hubot-hipchat/src/hipchat.js:206:24
2015-06-24T18:53:11.962053+00:00 app[web.1]:   at invokeCallback (/app/node_modules/hubot-hipchat/node_modules/rsvp/node/rsvp.js:161:15)
2015-06-24T18:53:11.962054+00:00 app[web.1]:   at Object.<anonymous> (/app/node_modules/hubot-hipchat/node_modules/rsvp/node/rsvp.js:193:9)
2015-06-24T18:53:11.962056+00:00 app[web.1]:   at /app/node_modules/hubot-hipchat/node_modules/rsvp/node/rsvp.js:13:16
2015-06-24T18:53:11.962058+00:00 app[web.1]:   at process._tickCallback (node.js:419:13)

Outdated dependencies

$ npm outdated

Package        Current  Wanted    Latest  Location
github           0.2.3   0.2.3     0.2.4  github
moment           2.9.0   2.9.0    2.10.3  moment
nodemailer       1.3.0   1.3.0     1.3.4  nodemailer
underscore       1.7.0   1.7.0     1.8.3  underscore
promise          6.1.0   6.1.0     7.0.3  promise
hubot           2.11.0  2.11.0    2.13.2  hubot
request         2.51.0  2.51.0    2.58.0  request
hubot-cron       0.2.7   0.2.7     0.2.9  hubot-cron
googlemaps      0.1.20  0.1.20     1.0.1  googlemaps
hubot-scripts   2.5.16  2.5.16    2.16.1  hubot-scripts
hubot-hipchat    2.7.5   2.7.5  2.12.0-5  hubot-hipchat
hipchatter       0.1.3   0.1.3     0.2.0  hipchatter

Why are there two bots?

image

I see this a lot, and then we have to call .die to kill the hubot process. Any ideas what's going on? Is it a Heroku configuration thing? A bug with hubot? Opening an issue so we can track this down - if you have ideas/information about it, please share here! ❤️

[memrem] create aliases for mem/rem commands

I have trouble remembering what rem and mem do, respectively. I would like to allow for simpler aliases to be used alongside the current commands.

  • rem == set
  • mem == get
@hubot set key value

# and

@hubot get key
> value

Slap the bot

When the bot doesn't return an image or when he is being snarky, slap him.

.botslap or maybe .botsmack

Not sure what he would say in response.

[memrem] add list feature

I would like to see a list of saved keys so that I know what is available to retrieve.

Potential output styles:

@hubot mem list

[key1, key2, key3, ...]
@hubot mem list

key1 
key2
key3
...

As a result, list would be a keyword and should not be a valid key for storing a key-value pair.

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.