summaryrefslogtreecommitdiff
path: root/megahal_bot.py
diff options
context:
space:
mode:
authoryvesf <yvesf@d0e8fea9-7529-0410-93fb-d39fd5b9c1dd>2009-12-07 08:22:55 +0000
committeryvesf <yvesf@d0e8fea9-7529-0410-93fb-d39fd5b9c1dd>2009-12-07 08:22:55 +0000
commitb56f9fb7612d5ab32c2a77fa47ef012b447b4be6 (patch)
treedfb2d1c1060a506fb1bcb924b5d451621fb3831b /megahal_bot.py
parent3b0e5ecaff8f622c3090d3ae66496ba0f5b7397d (diff)
downloadomegle-b56f9fb7612d5ab32c2a77fa47ef012b447b4be6.tar.gz
omegle-b56f9fb7612d5ab32c2a77fa47ef012b447b4be6.zip
foobar
git-svn-id: http://xapek.org/svn/common/omegle@1477 d0e8fea9-7529-0410-93fb-d39fd5b9c1dd
Diffstat (limited to 'megahal_bot.py')
-rw-r--r--megahal_bot.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/megahal_bot.py b/megahal_bot.py
index 9008db8..428ca6c 100644
--- a/megahal_bot.py
+++ b/megahal_bot.py
@@ -88,6 +88,8 @@ Argumente:
--host=HOST (Standard: HOST=omegle.com)
-d DBNAME or
--dbname=DBNAME Database (Standard: DBNAME=omegle)
+ --user=USER
+ --password=PASSWORD
-l or
--local Do local testing
-p NAME or
@@ -96,7 +98,7 @@ Argumente:
#parse args
try:
- opts, args = getopt.getopt(sys.argv[1:], "hp:d:l", ["help", "host=", "profile=","dbname=","local"])
+ opts, args = getopt.getopt(sys.argv[1:], "hp:d:l", ["help", "host=", "profile=","dbname=","local","user=","password="])
except getopt.GetoptError,err:
print str(err)
usage()
@@ -112,7 +114,7 @@ Argumente:
OR message ILIKE '%http%'
OR message ILIKE '%@%.%')
;""",
- "all":"""SELECT message FROM omegle_messages""",
+ "all":"""SELECT message FROM omegle_messages WHERE LENGTH(message) > 2 AND LENGTH(message) < 35""",
"offensive":
"""SELECT message FROM omegle_messages
WHERE ( message ILIKE '%sex%'
@@ -163,13 +165,18 @@ Argumente:
}
sqlKey = "standard"
dbname = "omegle"
-
+ user = "omegle"
+ password = "omegle"
for o, a in opts:
if o in ('-h', '--help'):
usage()
sys.exit(0)
elif o in ('-d', '--dbname'):
dbname = a
+ elif o in ('--user'):
+ user = a
+ elif o in ('--password'):
+ password = a
elif o in ('-l', '--local'):
local = True
elif o == "--host":
@@ -183,7 +190,7 @@ Argumente:
mh_python.initbrain()
- conn = pyPgSQL.PgSQL.connect(database=dbname,user="yvesf",password="iii",host="10.2.2.13")
+ conn = pyPgSQL.PgSQL.connect(database=dbname,user=user,password=password,host="10.2.2.13")
cur = conn.cursor()
print sql[sqlKey]
@@ -203,7 +210,7 @@ Argumente:
conn.close()
del messages
- logging.basicConfig(level=logging.ERROR)
+ logging.basicConfig(level=logging.DEBUG)
if local:
print "CTRL-C\n>>> ",
while True: