summaryrefslogtreecommitdiff
path: root/check.py
diff options
context:
space:
mode:
authorPanFritz <redstonenoobpan@gmail.com>2015-09-11 11:39:06 +0200
committerPanFritz <redstonenoobpan@gmail.com>2015-09-11 11:39:06 +0200
commitebb893289cc3d0f9979a2ca5c8ccac858c1a175d (patch)
tree678fe52f1727f938d28d40a748a5852618b67878 /check.py
parent449c5015444269ff631a819c426a4e48bce18683 (diff)
Converted to use async_query
Diffstat (limited to 'check.py')
-rw-r--r--check.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/check.py b/check.py
index 8bbfdeb..cd13a6b 100644
--- a/check.py
+++ b/check.py
@@ -31,14 +31,11 @@ def get_last_seen(player):
# receive link and email from website
-def get_website_data(player):
- conn = zxJDBC.connect(mysql_database, mysql_user, mysql_pass, "com.mysql.jdbc.Driver")
- curs = conn.cursor()
+def get_webite_data(player):
uuid = str(uid(player)).replace("-", "")
- curs.execute("SELECT DISTINCT `id`, `email` FROM users WHERE `uuid` = ? LIMIT 1", (uuid,))
- results = curs.fetchall()
- curs.close()
- conn.close()
+ async_query(mysql_database,"SELECT DISTINCT `id`, `email` FROM users WHERE `uuid` = ? LIMIT 1",(uuid,),get_website_data_target)
+
+def get_website_data_target(results):
return ("http://redstoner.com/users/%s" % results[0][0], results[0][1]) if results else (None, None)