A bot is born
Donginger is a bot written in Python by yours truly. The inspiration came after a discussion in the chatterbox
about chatbots, near the end of February 2008. Its original name was going to be Buttbot
(after seeing an IRC buttbot in action) but gnarl
suggested Donginger and it stuck.
Its first function was to quote, every 10 minutes, the last message in the catbox and randomly
replace words with one of the following: butt, dong, crotch and wang. Evidently, this generated a few laughs
here and there but mostly a lot of complaining from all the unfunny users of the chat. Eventually,
people started suggesting new features and I've
tried to implement most of them.
Due to bugs and poor testing of my part, there have been stories of Donginger flooding the catbox with nonsense until
forcibly stopped.
I believe that right now, most bugs have been corrected and I test all the new features in the Political Asylum.
Donginger now has a Facebook account: http://www.facebook.com/profile.php?id=1188676721
Friend him up!
Features
- New! 2008-08-04 He will pull out random insults from the OFFENDULON at the mention of "insult" or "I take offense".
- New! donginger topic will return a random topic.
- donginger random USERNAME will return a random quote by that user.
- /msg donginger random USERNAME will do the same but with less catbox clutter.
- Karma counter. It keeps track of all "++" and "--" said. You can check the current karma of something/someone by asking Donginger: karma WORD
- "Tell me/us about X" will generate a random markov chain sentence (completely unrelated to X) from its archive of the catbox.
- "Tell me/us about [link]" will generate a random markov chain sentence taken from the text of the node linked.
- He will reply to all questions directed at him.
- He will reply to any and all mentions of Bag of Crushed Child. He likes that little fellow.
- Anything else directed at him will be "buttified": random swapping of words with random stupid words.
- Other minor secret functions and easter eggs.
Most of Donginger's actions are triggered by starting your message with "Donginger:"
Technical stuff
Donginger keeps its own archive of the catbox, using an SQLite database. As of July 22, 2008 there are
16,400 lines of chat in it. This body of text is split into separate sentences and stored into a dictionary
for later use by the Markov Chain function, which uses a modified version of Greg McFarlane's
Python port of the Mark V. Shaney program.
Originally, the catbox parsing was done by fetching the HTML source code of the page, isolating the DIV
containing the catbox, removing all tags and looping over all the lines one by one, keeping only the author and
the message.
That was quite impractical but I thought it was the only way to go. That is, until kthejoker asked me if I was
aware of all the XML tickers available. After a good five minutes of stunned silence,
I rewrote everything to take advantage of this - halving the total code length in the process.
In order to parse the catbox, Donginger now uses the xml.dom.minidom Python module to go through the
obsolete chatterbox xml ticker.
Todo list
- Make him parse homenodes.
- Use the other XML tickers to allow more "useful" features.
Source code
I am not going to release the source code, firstly because I don't want to see
15 different bots in the chat.
Secondly, I want to keep development to myself. Finally, I'm not a professional programmer and I'm always a
bit shy to show my work.
The source code has 700 lines.