Coder Social home page Coder Social logo

pagebot's Introduction

pagebot

A bot to listen on IRC for a regex match, and notify a Slack room with the relevant mentions. Because you can't pay attention to every chat system all the time.

Despite having a reasonable config file, Pagebot is still hackware.

Installation

git-clone or scp the repo to the target machine.

Usage

Pagebot expects a file at config/bot_config.rb, with the following constants. An example file is at bot_config.rb.example.

SLACK_URL = "the Slack URL to post to",
SLACK_ROOM = "Ops"
REGEX = %r{wensleydale|cheddar|ed[ae]m}i

IRC_SERVER = "irc.freenode.net"
NICK = "bot_irc_nick"
NICKSERV_PASSWORD = "top-loading fruit"
CHANNELS = ["#edam", "#port_salut"]

RATE_LIMIT_PERIOD_SEC = 360
MENTIONS_PER_LIMIT_PERIOD = 2

Do bundle install to make sure the necessary gems are installed. Depending on your environment, bundle exec can probably be omitted.

The recommended way is to run Pagebot under the handy daemons gem, which will restart it if it crashes. Sometimes it stays connected to IRC but stops passing notifications; I have a cronjob kick it every night. (Scheduled restarts can probably be done using the daemons API; PRs welcome.)

./ctl_pagebot start

The control script also supports the standard stop, status, and restart subcommands.

You can run the script directly in the foreground, which will default to connecting to FreeNode:

./pagebot

or in debug mode, which forces it to connect to a local ircd. I use ngircd, probably available through your local package system; it requires no configuration, and speeds up development considerably compared to connecting to a public IRC network. (Specifically, I use ngircd -np.)

./pagebot -d

Feel free to ask questions via Github issues.

pagebot's People

Contributors

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