err-elizabot

a classic electronic shrink for the chatbot err
git clone https://git.ce9e.org/err-elizabot.git

commit
e9905ac1e5ffae38c2bdb3acb098d6434c43c948
parent
44b4afaa25c34e600d3d3f878c08cfcd7a8157b6
Author
Guillaume BINET <gbin@gootz.net>
Date
2012-06-09 11:33
added the !askus command

Diffstat

M elizaBot.py 10 ++++++++++

1 files changed, 10 insertions, 0 deletions


diff --git a/elizaBot.py b/elizaBot.py

@@ -1,6 +1,8 @@
   -1     1 import json
    1     2 from errbot.botplugin import BotPlugin
    2     3 from eliza import Eliza
    3     4 from errbot.jabberbot import botcmd
   -1     5 from urllib2 import urlopen
    4     6 
    5     7 __author__ = 'gbin'
    6     8 
@@ -12,3 +14,11 @@ class ElizaBot(BotPlugin):
   12    14         args = args.strip()
   13    15         return self.eliza_daemon.respond(args)
   14    16 
   -1    17     @botcmd
   -1    18     def askus(self, mess, args):
   -1    19         """ Give us a fun topic to talk about
   -1    20         """
   -1    21         content = urlopen('http://chatoms.com/chatom.json?Normal=1&Fun=2&Philosophy=3&Out+There=4&Love=5&Personal=7').read()
   -1    22         return json.loads(content)['text']
   -1    23 
   -1    24