Git Product home page Git Product logo

hubot's Introduction

Hubot (Ted Dziuba's Fork)

This is a fork of GitHub's Hubot that's substantially less shitty.

For as much as GitHub tithes the Church of Unix, they really blew it on Hubot. If you think about it, Hubot is a lot like old-school CGI. It takes text in from an adapter, decides what to do with that request, and spits text back out.

Sound familiar? Yeah, because it's standard in/standard out. Unix can do that all by itself with out all the stupid Node.js cancer.

This rewrite of Hubot accomplishes exactly that.

                              +############+
                              +## I HAVE ##+
    '$.` `$                   +## FOUND ###+
    @    ``$                  +## THE #####+
    :   ```$                  +## THINGS ##+
    $  ````$        '@@#      +##+''+''++#+#
    ```````$      @.$$$$$     +############+
    +'@.:.$#     .''+++@+:@   ++
       .:.      @$'@@@@''::  #+
       $@@      :$+++++''::  #
      $$$$::    @:::::@@@@@#
      $$$$:@    #'@$.$` $$::@
      $$$$:@ '$$$$` .  $$$$$$:
      ::@@@'+.$$$` . `$$@@':$:@
        :+  @.$$` . .':@'@@$:@@#
        @+  ':$` .  $$$$$$$$:@.'
        +$''$#  .  $$$:...$$::':
              :  $$$$$: ``.$:: +@
              @ $$$$$$:```.$::  $#
               '$$$$$$$$$$:::#$$$$::
                @@@:::::::''+ $$$$::
                   :''':'@    $$$$::
                   '+#:'+#    '$$$$'
                    @'@@'      ````
                     @@#
                     ''+
                     +'
                      #

        '.``````````````````````````.+

Motivation

I wanted GH-Hubot to deploy some code, which, in my setup, amounts to running fab deploy, and thought that Hubot would let me just run arbitrary shell commands, and I was wrong. After looking into it, I decided that GH-Hubot is like, well, anything people wore in the 80's. You're going to look back on that in a few years and say "what the fuck was I thinking?".

Yeah, and GH-Hubot needs Redis. Why the fuck would you need bot-side persistence so bad that you start a networked server to store it instead of using a file.

Want to do bot-side persistence with my Hubot? Go nuts, do what you will, but write your own adapter/plugin for it.

Getting Your Own

Dependencies you'll need:

  • bash
  • find

Basically the stuff you will find in a Unix/Linux distro worth using.

Some of the plugins and adapters have additional dependencies, most notably, the campfire adapter needs Python and the pip package "pyfire", which you can get by running sudo pip install pyfire.

Run Hubot

Run Hubot for Campfire:

export HUBOT_CAMPFIRE_SUBDOMAIN=xxx
export HUBOT_CAMPFIRE_PASSWORD=xxx
export HUBOT_CAMPFIRE_ROOM=xxx
export HUBOT_CAMPFIRE_USERNAME=xxx
bin/hubot -a campfire

Or just run it in shell"

bin/hubot

Adapters

My Hubot ships with both Campfire and shell adapters.

Creating an Adapter

Way easier here than with GitHub's Hubot. Plus, you don't have to dirty your hands with JavaScript.

An adapter in this fork of Hubot is an arbitrary program. It's best to make it a shell script, because you get to use the list_plugins bash function. Have a look at the shell adapter for a basic example.

list_plugins will return a list of paths to plugin binaries, which you can call as you see fit.

Scripts (Plugins)

Again, easier and more flexible than GH-Hubot. A plugin here is an arbitrary executable.

The preferred idiom is that every plugin gets executed for every line of input. If your plugin has nothing to say for that input line, it should say nothing and exit normally. If it wants to respond, it should print its response on standard out.

The adapter will read that response and do what it pleases with it.

Check out the campfire adapter for an example of how to execute plugins in parallel.

One cool feature that the Unix version of Hubot has that the Node.js version does not is that, to add a plugin, you just need to put the executable in the plugins directory. You do not need to restart Hubot.

hubot's People

Contributors

anaisbetts avatar andyfowler avatar assaf avatar atmos avatar benburkert avatar cesar-zz avatar ecarreras avatar eventualbuddha avatar excedrin avatar holman avatar jnewland avatar kneath avatar maddox avatar madzak avatar mange avatar markpasc avatar markstory avatar mathildelemee avatar mexitek avatar oinutter avatar russelldavis avatar skalnik avatar technoweenie avatar teddziuba avatar titanous avatar tmm1 avatar tombell avatar twinshadow avatar unixcharles avatar vrtak-cz avatar

Stargazers

 avatar

Watchers

 avatar  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.