Skip to content

Commit 7327a9d

Browse files
committed
Minor modifications made on 11th May 2015
1 parent 677eefe commit 7327a9d

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

xmpp_aiml.py

+11-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Uses PyAIML and xmpppy
33
#
44
# Author - Harshad Joshi
5-
# Date - May 6, 2011
5+
# Date - May 6, 2011 / May 11, 2015
66
#
77
# Requirements - XMPP chat server (openfire)
88
# - Python 2.5 with xmpp and PyAIML library.
@@ -24,11 +24,13 @@
2424
import xmpp
2525
import codecs
2626
import aiml
27+
from datetime import datetime
2728

2829

29-
30-
passwd='gmailpasswd'
31-
server='gmail.com'
30+
31+
user='jabber account @ server'
32+
passwd="your password"
33+
server='jabbim.cz'
3234

3335

3436
# the heart and brain of bot...
@@ -39,6 +41,8 @@
3941

4042
k.respond("load aiml b")
4143

44+
a = open("chat.txt","a")
45+
4246

4347
#this snippet handles presence and subscription...automatically subscribes to user who request subscription. Not recommended for public use.
4448
def presence_handler(connection_object, message_node):
@@ -55,8 +59,9 @@ def message_handler(connect_object,message_node):
5559
command2=str(message_node.getFrom().getStripped())
5660

5761
#the fun begins from this place..
58-
connect_object.send(xmpp.Message(command2,(k.respond(command1))))
59-
62+
connect_object.send(xmpp.Message(command2,(k.respond(command1))))
63+
b = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
64+
a.write(str(b) + " " + command2 + " >>> " + k.respond(command1) + "\n")
6065

6166
jid=xmpp.JID(user)
6267
connection=xmpp.Client(server)

0 commit comments

Comments
 (0)