From 09fa481b3181129d4acb02a969abd08ffa753025 Mon Sep 17 00:00:00 2001 From: yvesf Date: Thu, 11 Jun 2009 10:25:13 +0000 Subject: ibla git-svn-id: http://xapek.org/svn/common/omegle@1108 d0e8fea9-7529-0410-93fb-d39fd5b9c1dd --- megahal_local.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'megahal_local.py') diff --git a/megahal_local.py b/megahal_local.py index cb96a0f..b17316f 100644 --- a/megahal_local.py +++ b/megahal_local.py @@ -2,20 +2,27 @@ import mh_python import pyPgSQL.PgSQL mh_python.initbrain() -print "\033[2J" conn = pyPgSQL.PgSQL.connect("") cur = conn.cursor() -cur.execute("SELECT message FROM omegle_messages") -messages = cur.fetchall() +cur.execute(""" +SELECT message FROM omegle_messages +WHERE NOT ( message ILIKE '%www.%' + OR message ILIKE '%http:%' + OR message ILIKE '%@%.%'); +""") c=0 -for message in messages: - c+=1 - if c%20==0: - print "%s%s/%s" % ("\033[2K\033[E",c,len(messages)), - mh_python.learn(message[0]) +while True: + messages = cur.fetchmany(1000) + if len(messages)==0: + break + for message in messages: + c+=1 + if c%50==0: + print "%s%s" % ("\033[2K\033[E",c), + mh_python.learn("%s"%message[0]) print "" cur.close() -- cgit v1.2.1