3 ms·
Yardbird - building IRC bots with Django
- petercooper 17y agoIf you're in Ruby land, consider Isaac (nice demo at http://railstips.org/2008/11/14/sinatra-for-irc http://railstips.org/2008/11/14/sinatra-for-irc) or Autumn (http://github.com/RISCfuture/autumn/tree/master http://github.com/RISCfuture/autumn/tree/master). Isaac is particularly syntactically appealing.
- zxcvb 17y agoWhy would you post links to ruby based irc frameworks here? I might as well of come here and posted VB, C++, or any other language, it's just spam. Not that we expect much more from a rails user though
- blinks 17y agoThis is a really cool idea. The crux of the article: ---- The code for bucket has a lot of logic that goes like this:: if ($msg =~ GREATBIGHOARYREGEX) { ... else if ($msg =~ ANOTHERCRAZYREGEX) { ... And so I thought to myself "Gosh, wouldn't it be great if this had a dispatch mechanism where you could associate regexes with functions in some kind of data structure, along with some kind of application data for context?" Oh hangon, that reminds me of... http://docs.djangoproject.com/en/dev/topics/http/urls/ I've been looking at twisted, which seems to be the system of choice for writing IRC bots. It's a bit hairy and bureaucratic, unfortunately. The examples for setting up basic IRC bots are clean enough, but once you turn the page it's all factories and reactors and aspect-oriented bragging about how great it is to reduce your code to dozens of three-line classes. But it gives you that great responsive asynchronous network library, which is nothing to sneeze at! Django doesn't have any facilities for network protocols or asynchronous coding, because it assumes that apache or some other web server will take care of all that for you. Once this occurred to me, the light really went on: twisted need only provide a sort of "IRC Client Server" model, and dispatch incoming requests to Django code the way apache does!
- apgwoz 17y agoInteresting. This is the second project that's taking ideas from web frameworks and repurposing them to solve other problems. The other that I'm thinking of, is of course Zed Shaw's Lamson (http://lamsonproject.org http://lamsonproject.org)