diff options
Diffstat (limited to 'megahal_icq.py')
-rw-r--r-- | megahal_icq.py | 49 |
1 files changed, 27 insertions, 22 deletions
diff --git a/megahal_icq.py b/megahal_icq.py index f9afeaa..8ae3dd6 100644 --- a/megahal_icq.py +++ b/megahal_icq.py @@ -1,6 +1,7 @@ #!/usr/bin/python import struct import sys +import thread from twisted.words.protocols import oscar from twisted.internet import reactor, protocol @@ -11,30 +12,31 @@ uin = '370496181' print "Enter icq password(megahal...): ", password = sys.stdin.readline().strip() -mh_python.initbrain() +def fill_hal(): + mh_python.initbrain() -conn = pyPgSQL.PgSQL.connect(database="omegle") -cur = conn.cursor() + conn = pyPgSQL.PgSQL.connect(database="omegle") + cur = conn.cursor() -cur.execute(""" -SELECT message from omegle_messages WHERE LENGTH(message) BETWEEN 3 AND 30 -AND NOT ( message ILIKE '%www.%' - OR message ILIKE '%http%' - OR message ILIKE '%@%.%') -""") -messages = cur.fetchall() -c=0 -for message in messages: - c+=1 - if c%500==0: - print "%s%s/%s" % ("\033[2K\033[E",c,len(messages)), - #XXX pass massage[0] to mh and end with a fucked up python - mh_python.learn("%s " % (message[0])) + cur.execute(""" + SELECT message from omegle_messages WHERE LENGTH(message) BETWEEN 3 AND 30 + AND NOT ( message ILIKE '%www.%' + OR message ILIKE '%http%' + OR message ILIKE '%@%.%') + """) + messages = cur.fetchall() + c=0 + for message in messages: + c+=1 + if c%500==0: + print "%s%s/%s" % ("\033[2K\033[E",c,len(messages)), + #XXX pass massage[0] to mh and end with a fucked up python + mh_python.learn("%s " % (message[0])) -print "%s%s/%s" % ("\033[2K\033[E",len(messages),len(messages)) -cur.close() -conn.close() -del messages + print "%s%s/%s" % ("\033[2K\033[E",len(messages),len(messages)) + cur.close() + conn.close() + del messages @@ -56,6 +58,8 @@ class icqBot( oscar.BOSConnection ): self.setProfile("Forget ICQ, MSN, Yahoo and the other shitty protocols! Use Jabber!") self.setIdleTime( 0 ) self.clientReady() + for user in buddylist[0][0].users: + self.sendAuthorizationResponse(user.name, True, '') print buddylist print 'ICQ-Autoresponder-Bot aktiviert ;-)' @@ -89,7 +93,8 @@ class icqBot( oscar.BOSConnection ): class OscarCrap( oscar.OscarAuthenticator ): BOSClass = icqBot - + +thread.start_new_thread(fill_hal,()) protocol.ClientCreator( reactor, OscarCrap, uin, password, icq=1 ).connectTCP( 'login.icq.com', 5238 ) reactor.run() |