GithubHelp home page GithubHelp logo

lguzzon-scratchbook / beehive Goto Github PK

View Code? Open in Web Editor NEW

This project forked from muesli/beehive

0.0 1.0 0.0 5.89 MB

A flexible event and agent system with lots of bees

License: GNU Affero General Public License v3.0

Shell 0.50% Go 99.50%

beehive's Introduction

Beehive

Beehive is an event and agent system, which allows you to create your own agents that perform automated tasks triggered by events and filters. It is modular, flexible and really easy to extend for anyone. It has modules (we call them Hives), so it can interface with, talk to, or retrieve information from Twitter, Tumblr, Email, IRC, Jabber, RSS, Jenkins, Hue - to name just a few. Check out the full list of available Hives in our Wiki.

Connecting those modules with each other lets you create immensly useful agents.

Here are just a few examples of things Beehive could do for you:

  • Re-post tweets on your Tumblr blog
  • Forward incoming chat messages to your email account
  • Turn on the heating system if the temperature drops below a certain value
  • Run your own IRC bot that lets you trigger builds on a Jenkins CI
  • Control your Hue lighting system
  • Notify you when a stock's price drops below a certain value

beehive's Logo

Installation

Make sure you have a working Go environment. See the install instructions.

To install beehive, simply run:

go get github.com/muesli/beehive

To compile it from source:

cd $GOPATH/src/github.com/muesli/beehive
go get -u
go build

Run beehive --help to see a full list of options.

Configuration

Think of Hives as little plugins, extending Beehive's abilities with events you can react on and actions you can execute.

Just as examples, there's a Twitter plugin that can

  • react to someone you follow posting a tweet (an event)
  • post a new tweet for you (an action)
  • ...

or an RSS plugin that lets you

  • monitor RSS feeds and react on new feed items (another event)

or an email plugin that gives you the ability to

  • send emails (another action)

Each Hive lets you spawn one or multiple Bees in it, all working independently from another. That allows you to create separate plugin instances, e.g. one email-Bee for your private mail account, and another one for your work email.

Creating Bees

Sounds complicated? It's not! Just for fun, let's setup Beehive to send us an email whenever an RSS feed gets updated. Start beehive and open http://localhost:8181/ in your browser. Note that Beehive will create a config file beehive.conf in its current working directory, unless you specify a different file with the -config option.

Note: You currently have to start beehive from within $GOPATH/src/github.com/muesli/beehive in order for it to find all the resources for the admin interface. Also see the Troubleshooting & Notes section of this README.

The admin interface will present you with a list of available Hives. We will need to create two Bees here, one for the RSS feed and one for your email account.

New Bees

Setting up a Chain

Now we will have to create a new Chain, which will wire up the two Bees we just created. First we pick the Bee & Event we want to react on, then we pick the Bee we want to execute an Action with. The RSS-Bee's event gives us a whole set of parameters we can work with: the feed item's title, its links and description among others. You can manipulate and combine these parameters with a full templating language at your disposal. For example we can set the email's content to something like:

Title: {{.title}} - Link: {{index .links 0}}

Whenever this action gets executed, Beehive will replace {{.title}} with the RSS event's title parameter, which is the title of the feed item it retrieved. In the same manner {{index .links 0}} becomes the first URL of this event's links array.

New Chain

That's it. Whenever the RSS-feed gets updated, Beehive will now send you an email! It's really easy to make various Bees work together seamlessly and do clever things for you. Try it yourself!

You can find more information on how to configure beehive and examples in our Wiki.

Troubleshooting & Notes

The web interface and other resources aren't currently embedded in the binary. Beehive tries to find those files in its current working directory, so it's currently recommended to start Beehive from within its git repository, if you plan to use the web interface.

Should you still not be able to reach the web interface, check if the config directory in the git repository is empty. If that's the case, make sure the git submodules get initialized by running git submodule update --init.

The web interface does not require authentication yet. Beehive currently accepts all connections from the loopback device only.

Development

Need help? Want to hack on your own Hives? Join us on IRC (irc://freenode.net/#beehive) or Gitter. Follow the bees on Twitter!

API docs can be found here.

Build Status Go ReportCard

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.