Sen descrición http://bits.zero9f9.com/pybot

Matt Weller c53dbe4889 barely functional but apparently stable threadinfo snippet incoming %!s(int64=9) %!d(string=hai) anos
docs 3d17959380 docs? %!s(int64=9) %!d(string=hai) anos
modules c53dbe4889 barely functional but apparently stable threadinfo snippet incoming %!s(int64=9) %!d(string=hai) anos
tests 9e1a6deb9f remove all the crazy config loading logic and positional requirements. replaced with argparse. airquotes bugfix release %!s(int64=9) %!d(string=hai) anos
.gitignore 5c323a799f add *.db to gitignore %!s(int64=10) %!d(string=hai) anos
.travis.yml 7e612b701c disable irc notifications %!s(int64=10) %!d(string=hai) anos
CHANGES 5341af6dbd update CHANGES and version.py %!s(int64=10) %!d(string=hai) anos
README.md 73e223a5c2 README.md edited online with Bitbucket %!s(int64=9) %!d(string=hai) anos
Vagrantfile 3e44c8e9f9 Automate development environment configuration %!s(int64=10) %!d(string=hai) anos
bootstrap.sh 3e44c8e9f9 Automate development environment configuration %!s(int64=10) %!d(string=hai) anos
bot.py 004f6c41cb remove daemon = True for the backgrounded threads %!s(int64=9) %!d(string=hai) anos
botbrain.py 40d814b3f6 fix utf8/str concatenation bug in botbrain %!s(int64=9) %!d(string=hai) anos
conferror.py 9945b98ebd create dev branch. work on confman, which is currently correctly parsing ~/.pybotrc and setting internal variables. add some try excepts on connecting to the socket %!s(int64=11) %!d(string=hai) anos
confman.py 547605d931 add capacity for confman to take an optional string instead of file to turn into a configuration object %!s(int64=9) %!d(string=hai) anos
db.py 9c33965c09 foo %!s(int64=9) %!d(string=hai) anos
event.py 9c33965c09 foo %!s(int64=9) %!d(string=hai) anos
lite.py a9c3442525 rename functions intended to be used by class callers from with underscores to without, so sphinx docs catches them %!s(int64=10) %!d(string=hai) anos
logger.py 71efa36785 cleanup logger and bot's output to it, add logger output to reflect and snippetutil %!s(int64=9) %!d(string=hai) anos
mysql_dump 85fac2f4d4 fix debug log output in bot.py, fix poor programming in nicklist (still not fully functional), fix mysql_dump missing a few tables. %!s(int64=10) %!d(string=hai) anos
pybotrc 070c1e86c2 fix testBase and add a test pybotrc (so your local one doesn't fuck up your tests) %!s(int64=9) %!d(string=hai) anos
requirements.txt 9bfac6efd9 add requirements.txt update to include isodate %!s(int64=9) %!d(string=hai) anos
run.sh 2b732793c1 fix for youtube v2 api shutdown and an additional kanbo action %!s(int64=9) %!d(string=hai) anos
setup.sh 3d1a70facb add setup.sh and modify README to tell people to use it %!s(int64=10) %!d(string=hai) anos
stats.py 5951643a37 begin work on stats, i guess, and fix a few typos in webwriter. remove extraneous print from botbrain, too %!s(int64=11) %!d(string=hai) anos
ubuntu.sh f6de3aaa5e rollback import changes and re-add ubuntu.sh script %!s(int64=10) %!d(string=hai) anos
util.py 065e982eab working on reload function for snippets %!s(int64=10) %!d(string=hai) anos
version.py b7bb206326 increment version to 0.9.0 because that's really cool %!s(int64=9) %!d(string=hai) anos
webwriter.py 24cef71530 add sqlite functionality. fixes #3, after a long, long time %!s(int64=10) %!d(string=hai) anos

README.md

Build Status

ReadTheDocs documentation

pybot is a python irc bot. he is a project.

he is modular, extensible, multi-threaded, and configurable.

pybot runs on python 2.6 and 2.7, on both windows and linux. python versions > 3 are in the works.

(Now probably more than) 10-second TL;DR:

Take care of dependencies. If you don't use MySQL and don't care about twitter posting or reddit info, you don't need anything but python 2.7 and standard libs.

  • python-dev
  • libmysqlclient-dev (aka mysql-python in pip)
  • requests
  • praw (for reddit info module)
  • mysql-python (if you do use mysql)
  • sphinx (for docs)
  • python-twitter (twitterposter)

Local Development (with sqlite3)

  1. Copy pybotrc to the user who will run the bot (you can probably do cp pybotrc ~/.pybotrc)
  2. Modify ~/.pybotrc with your network, owner, and nickname.
  3. ./bot.py
  4. laugh at mysql guys.
  5. continue laughing.
  6. for debugging purposes, ./bot.py -d.

Local Development (with MySQL)

  1. modify pybotrc with your channels and passwords.
  2. run sudo ./bootstrap.sh to install pybot dependencies such as mysql.
  3. run ./setup.sh. It will check for module dependencies and create a mysql_init file. mysql -p < mysql_init
  4. ./bot.py pybotrc
  5. rejoice.
  6. for debugging purposes, ./bot.py -d.

Manual

Add a mysql user for pybot with permissions to update, insert, and delete from the created tables. Logged into mysql: grant all on <dbname>.* to '<username>' identified by '<password>';


Run the included mysql_dump file (as root, mysql -p <pybot's database name> < mysql_dump). Set his dbpass in the config file (pybotrc) to the password you've given him. Copy that config file to the home folder of whatever user will be running the bot. (~user/.pybotrc) As that user, ./bot.py.

Vagrant Development

If you have Vagrant locally installed and configured, you can set up pybot by invoking vagrant up. Your development environment will be configured, and you can skip step 1 and 2 above. After that, SSH into your VM and do steps 3 through 5 to finish things off.

Images & Explanation

debug mode

Here pybot is connected to two networks at once. They are held entirely separately. Modules loaded on one are independent of modules loaded on another. If one server goes down, the other connections to other networks are unaffected.

youtube module

a totally not contrived example