diff options
author | yvesf <yvesf@d0e8fea9-7529-0410-93fb-d39fd5b9c1dd> | 2009-06-10 09:13:32 +0000 |
---|---|---|
committer | yvesf <yvesf@d0e8fea9-7529-0410-93fb-d39fd5b9c1dd> | 2009-06-10 09:13:32 +0000 |
commit | 75814d6b8085f6b05870e6ec1bfc301a1d3a5e6c (patch) | |
tree | 4dde73f80034b7b018a9e6edb5f81d042e479555 | |
parent | 5515a3aefb0ae18b06780788af839ddebf1c8485 (diff) | |
download | omegle-75814d6b8085f6b05870e6ec1bfc301a1d3a5e6c.tar.gz omegle-75814d6b8085f6b05870e6ec1bfc301a1d3a5e6c.zip |
yiha
git-svn-id: http://xapek.org/svn/common/omegle@1100 d0e8fea9-7529-0410-93fb-d39fd5b9c1dd
-rw-r--r-- | megahal_bot.py | 18 | ||||
-rw-r--r-- | omegle.py | 4 |
2 files changed, 13 insertions, 9 deletions
diff --git a/megahal_bot.py b/megahal_bot.py index 26f5d17..48b8250 100644 --- a/megahal_bot.py +++ b/megahal_bot.py @@ -43,7 +43,7 @@ class MegahalBot(OmegleChat): def on_connect(self): print self.c("%s [EVT] %s Connection confirmed" % (time.strftime("%H:%M:%S"), self.name)) - self.send("Hi!") + self.send(u"Hi %s!" % self.name) def on_disconnect(self): @@ -66,7 +66,8 @@ if __name__ == "__main__": c+=1 if c%20==0: print "%s%s/%s" % ("\033[2K\033[E",c,len(messages)), - mh_python.learn(message[0]) + #XXX pass massage[0] to mh and end with a fucked up python + mh_python.learn("%s " % (message[0])) print "" cur.close() @@ -76,16 +77,17 @@ if __name__ == "__main__": print "press ctrl-c to abort" event = Event() - bot=MegahalBot(event,"A",ma_host="localhost:8082",color=colors['red']) + #bot=MegahalBot(event,"A",ma_host="localhost:8082",color=colors['red']) + bot=MegahalBot(event,"A",color=colors['red']) bot.start() try: - while True: - event.wait(0.5) - if event.isSet(): - print "partner" - break + while True: + event.wait(0.5) + if event.isSet(): + print "partner" + break except KeyboardInterrupt: print "CTRL-C pressed, exiting" @@ -133,7 +133,9 @@ class OmegleChat(RESTClient): self.logger.error("Cant send message if not is_confirmed") return ###XXX raise?? - r = RESTClient.request(self,"POST","/send",urllib.urlencode({'id':self.id,'msg':msg})) + params = {'ala':'gaga','id':self.id,'msg':msg,'zla2':'gaga2'} + params = urllib.urlencode(params) + r = RESTClient.request(self,"POST","/send",params) body = r.read() if body != "win": self.logger.error("/send; Bad response %s" % body) |