LaServ (a play on Lazers, The Bridge's feedbot and '*Serv' bots, which provide IRC services ) is a pythonPython/twistedTwisted project that I've been poking at since the Christmas break. It'sIt's still beta quality, but it's ready for more eyes and input. In it'sIn its current incarnation, it is an IRC bot, but the overall project is far more flexible and extensible than the label "IRC bot" normally indicates.
- IRC protocol client/'bot
- Can poll and read the question feed from a given StackExchangeStack Exchange site (currently configured for Gaming.SE)
- Can read, parse, and output RSS feeds (Currently configured for the Starred Items feed for The Bridge)
- Can store persistent user information, including API 2.0 access_tokens.
- Responds to some commands that are access_token related via a private message (inbox to read your unread inbox items, rep to see your current/daily/weekly/etc. reputation, for example)
- Full Twisted-compatible support for StackExchangeStack Exchange API v2.0, including authenticating users with access_tokens
access_tokens
- Can "poll" the API for things like question feeds, and "on demand" query the API for things like unread inbox/rep on demand.
- Support for RSS feeds including Conditionalconditional GET
- Flexible plugin architecture for adding new features while the appapplication is still running
- Loose, python-esquepythonic bindings between components, allowing for easy repurposing and refactoring
Essentially, although LaServ is an IRC bot with a few limited functions today, it could just as easily communicate via any protocol with Twisted support, and it could access any API endpoint of your/my choosing. TheThe limits are only the bounds of Python and the API. PluginsPlugins are lightweight, and the libraries provided abstract most of the complexity without sacrificing flexibility.
Having said that, I don't really know what's next for it, so part of my reason for posting it here is to find out how it could be useful in the future. TheThe libraries could be more robust, it could have more interface options, or it could have expanded command options via plugins, among many things.
If, after evaluating it, you have an idea or a request, or wish to contribute, please let me know. IfIf there's not much interest in it, I'll probably continue using it in its current form and move on to the next idea in my project list. :)
laserv.py is the main entry point for the application. FilesFiles under "lscore" are core libraries that are essential to proper operation of the system. FilesFiles under "lsplugins" are optional libraries that can be loaded, unloaded, or reloaded at runtime.
Everything in LaServ is released under the BSD 2-clause license for easy inclusion in the project of your choice. II would appreciate acknowledgement/upvotes/manilla envelopes stuffed with unmarked bills if you find parts of the project useful.
Right now, the code is hosted at BitBucketBitbucket, since I'm a fan of MercurialMercurial, although I'm not exactly married to this provider.
I'm running on CentosCentOS 5.x, which has Python 2.4 and some very old Twisted libraries. TheThe EPEL reporepository has python26Python 2.6 packages, but I had to roll my own python26python 2.6-twisted and python26python 2.6-feedparser. TheThe .spec files are included in the source tree in case you're in a similar position, but most "sane" distributions of Linux should be fine, and Windows users can install from the official releases.
LaServ looks for laserv.cfg in the directory where laserv.py is for configuration options. TheThe configuration file format is "ini" style. AnAn example is provided with the basic options set to default values. IfIf there's a configuration option you need that isn't supported, adding it is (usually) trivial, so don't be afraid to ask.