From b56f9fb7612d5ab32c2a77fa47ef012b447b4be6 Mon Sep 17 00:00:00 2001 From: yvesf Date: Mon, 7 Dec 2009 08:22:55 +0000 Subject: foobar git-svn-id: http://xapek.org/svn/common/omegle@1477 d0e8fea9-7529-0410-93fb-d39fd5b9c1dd --- megahal_bot.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'megahal_bot.py') 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: -- cgit v1.2.1