Giter VIP home page Giter VIP logo

ircbots's Introduction

micolous/ircbots

IRC bots created for the #blackhats IRC network. The bots all follow a pretty similar structure. Not all the bots are in use, but they're kept in this repository for historical purposes.

This includes a Python IRC library, ircasync.py. The library was originally written by W3C, but I've made some additions and changes to make it more Pythonic. The library still needs some work though.

There's also an IRC server (carirc) that I wrote as a competition with @aktowns while in a car coming home from Sydney. More details of the competition parameters and implementation details are in it's source file, ircserver.py. It only implements a subset of the IRC protocol (enough to make clients happy) and does some things strangely.

Implementation of the Global Cooldown Timer / WHY IS REGEXBOT IGNORING ME ITS BROKEN YOU SUCK

Most of the command-oriented bots implement a Global Cooldown Timer.

What happens is every time the bot is issued a command. the time is recorded. If the time since the last command is less than the cooldown duration (default 5 seconds) it'll ignore the command and reset the cooldown timer.

Once the cooldown timer is up, it'll accept commands again. Magic.

The reason for this is because then you can't flood regexbot with commands and have it be flooded out of the server.

In regexbot, this cooldown timer will be set regardless of any errors (missing slashes, invalid seperators, regex errors, substitution errors. So wait a few seconds before sending a corrected command, and re-read your regex so it's right.

bots

All of the bots use configparser_plus, which is available from this git repository.

feedbot

Requires feedparser.

linkbot

IRC bot that links two different IRC channels (presumably on different networks) together. Poor man's way to link together two IRC servers.

Note that joins, parts, quits, bans, kicks etc. are not propegated by this bot, and it is not possible to administer one channel from the other side.

If you want more complete functionality, you should set up proper IRC links. This bot is designed for where that is not possible to do.

regexbot

Requires python 2.6+ and regex libraries http://pypi.python.org/pypi/regex

A simple IRC bot that keeps a rotating list of messages to perform regular expressions on. By default it keeps 25 messages in it's buffer, but this can be changed with a configuration change.

It records all messages it sees, except regular expressions. You perform a substitution like this:

s/original/replacement/

It only supports the i (case insensitive) option, and is always greedy (g-option). It has Perl-compatible regular expressions.

Escaping forward slashes is not supported, instead represent a forward slash with the octal escape sequence \057. Or you can use one of the alternative syntaxes, s@, s#, s%, s: or s;.

The bot features an ignore-list and "global cooldown timer", so it will ignore people with a hostmask you specify (as a regular expression, of course), and also ignore those when too many commands are sent.

twitterbot

Requirements: pip install python-twitter oauth2

(Note: this requires python-twitter, not twitter. The other library is incompatible. You will need to delete it in order to use this.)

This also has some geocoder support, you'll need an experimental branch of geopy. Details here: http://code.google.com/p/geopy/wiki/ReverseGeocoding You don't need to have this installed, you just won't get geocoder support without it. If you have an old version of python-twitter, such as the one in Debian 6, then you shouldn't install this. Because that version of the library doesn't support geo extensions in Twitter.

Upon posting a URL of a tweet, twitterbot will display the tweet.

merging with me in a non-exclusive union of source trees

Please send me pull requests on github: https://github.com/micolous/ircbots

Either that or if there are too many MacBook-touting hipsters on github for your liking, you can email me a patch file. There's a link on my website, http://micolous.id.au/

I'm only going to merge bots that are general enough in purpose. For example:

  • Bot that randomly kicks @peerau out of the channel between every 6 and 49 minutes -- rejected
  • Bot that randomly kicks anyone out of the channel based on user-definable rules -- accepted

I'll keep an eye on the forks too, if there's something general enough or improvements to the library that'll get pulled in.

ircbots's People

Contributors

micolous avatar keeperofdakeys avatar rmcfadzean avatar peerau avatar

Stargazers

 avatar Stephen Harris avatar Niklas Hedlund avatar /sbin/Southen avatar Robert Perry avatar  avatar  avatar  avatar  avatar

Watchers

 avatar James Cloos avatar /sbin/Southen avatar Vlad avatar  avatar

ircbots's Issues

/g flag for regex.py

Would it be possible to have this disabled? At the moment it is on by default

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.