summaryrefslogtreecommitdiff
path: root/megahal_local.py
diff options
context:
space:
mode:
authoryvesf <yvesf@d0e8fea9-7529-0410-93fb-d39fd5b9c1dd>2009-06-11 10:25:13 +0000
committeryvesf <yvesf@d0e8fea9-7529-0410-93fb-d39fd5b9c1dd>2009-06-11 10:25:13 +0000
commit09fa481b3181129d4acb02a969abd08ffa753025 (patch)
tree2aa5e53243aaba58444045242621a89b07566930 /megahal_local.py
parent8f3af268d4091fd6488a23480cbfdd9351046f42 (diff)
downloadomegle-09fa481b3181129d4acb02a969abd08ffa753025.tar.gz
omegle-09fa481b3181129d4acb02a969abd08ffa753025.zip
ibla
git-svn-id: http://xapek.org/svn/common/omegle@1108 d0e8fea9-7529-0410-93fb-d39fd5b9c1dd
Diffstat (limited to 'megahal_local.py')
-rw-r--r--megahal_local.py23
1 files changed, 15 insertions, 8 deletions
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()