Giter Site home page Giter Site logo

pyirccat's Introduction

pyirccat - python irccat

What?

pyirccat is a self contained irccat clone written in Python. It was primarily developed for use at Lovestruck.com which uses IRC extensively for logging and reporting various things from servers back to IRC. Pull requests, comments etc are welcome.

Why?

First, irccat doesn't support SSL enabled IRC servers, which if your IRC servers are SSL only presents a bit of a problem. Second, other irccat clones usually have some dependency on a big external IRC/networking library (twisted, irclib and various others) and I just wanted something simple and lightweight which is trivially installed -- Lovestruck was rolling a JRE in production just to support catting things back to IRC, which seemed a bit silly. Third, because I'm the kind of idiot who enjoys being subjected to sockets programming and threads. pyirccat's only external dependency is pyOpenSSL (which is fair enough, right?)

How?

pyirccat listens on a specific ip and port and writes incoming data back to an irc channel. This is useful for sending various things (logs, whatever) to IRC from shell scripts or whatever else. As previously mentioned, it supports plain and SSL enabled IRC servers, and password protected IRC servers too.

> python pyirccat.py
usage: pyirccat.py [-h] -s HOST [-p PORT] [--password PASSWORD] [-n NICKNAME]
                   -c CHANNEL -ba BIND_ADDR -bp BIND_PORT [--ssl] [-v]

pyirccat - cat to irc

optional arguments:
  -h, --help            show this help message and exit
  -s HOST, --server HOST
                        IRC Server hostname
  -p PORT, --port PORT  IRC Server port
  --password PASSWORD   IRC server password
  -n NICKNAME, --nickname NICKNAME
                        Nickname of bot
  -c CHANNEL, --channel CHANNEL
                        Channel to join, without # prefix
  -ba BIND_ADDR, --bind-addr BIND_ADDR
                        IP to bind to
  -bp BIND_PORT, --bind-port BIND_PORT
                        Port to bind to
  --ssl                 Join server via SSL
  --ssl-no-verify       Disable SSL cert verification
  -v, --verbose         Noisy mode

Example:

> python pyirccat.py -s irc.freenode.net -p 6667 -n mybotnickname -c mychannel -ba 0.0.0.0 -bp 4444

then send some data to it (telnet, netcat, whatever - examples shown use netcat)

> echo "Hello World" | netcat -q0 localhost 4444
> tail -f /var/log/www/error.log | netcat localhost 4444

You can also prefix output with an arbitary channel to send to, e.g. -

> echo "#someotherchannel foo" | netcat -q0 localhost 4444

(would send to #someotherchannel even if you invoked the bot with a channel other than #someotherchannel)

Installation

Just make sure you've pyOpenSSL available, and it will be good to go on python 2.7+. Included is a pip requirements file which can be used via

> pip install -r requirements.txt

You'll probably need libffi in order to install pyopenssl (most linux package managers will have it readily available)

When?

pyirccat's People

Stargazers

 avatar  avatar

Watchers

 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.