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, 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: donginger random USERNAME will return a random quote by that user.
- New: donginger last USERNAME will return the last thing say by this user.
- New: Karma counter. It keeps track of all "++" and "--" said. You can check the current karma of something/someone by asking Donginger: karma WORD
- Placing the word "cool" anywhere in a sentence will make him reply with a random recently Cooled write-up.
- "Tell me/us about X" will generate a random markov chain sentence (completely unrelated to X) from its database archive.
- "Tell me/us about [link]" will generate a random markov chain sentence taken from the text of the node linked.
- He will reply to questions with a random reply.
- 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 this writing, there are
14,000 lines of chat in it. This body of text is splitted 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 chat messages, removing all tags and looping over all the lines one by one, keeping 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 take orders from private messages.
- 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 520 lines.
|