root vor 2 Jahren
Ursprung
Commit
24d14a62b6
5 geänderte Dateien mit 19 neuen und 9 gelöschten Zeilen
  1. 10 0
      INNNews/\033\033\033ggie
  2. 3 3
      INNNews/general_clickbot.py
  3. 2 2
      INNNews/run_sheet_2.py
  4. 1 1
      INNNews/run_sns.py
  5. 3 3
      INNNews/sns_clickbot.py

+ 10 - 0
INNNews/\033\033\033ggie

@@ -0,0 +1,10 @@
+NAME
+    run_sheet_2.py
+
+SYNOPSIS
+    run_sheet_2.py COMMAND
+
+COMMANDS
+    COMMAND is one of the following:
+
+     get

+ 3 - 3
INNNews/general_clickbot.py

@@ -22,8 +22,6 @@ import fire
 #pymysql.install_as_MySQLdb()
 
 
-db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/seo?charset=utf8mb4')
-table=db['general_log']
 driver = None
 
 
@@ -48,6 +46,8 @@ def empty_query(q):
 
 
 def process_query(qs):
+    db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/seo?charset=utf8mb4')
+    table=db['general_log']
     q=qs[0]
     domain=qs[1]
     global driver
@@ -89,7 +89,7 @@ def process_query(qs):
                 time.sleep(5)
                 break
         idx+=1
-
+    db.close()
 def run_once(q):
     global driver
     result=[]

+ 2 - 2
INNNews/run_sheet_2.py

@@ -38,7 +38,7 @@ def run_once(pport, dockername):
     if intval == -1:
         print('-1')
         sys.exit()
-
+    db.close()
 
 def run_specific(pport, dockername):
     db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/seo?charset=utf8mb4')
@@ -59,7 +59,7 @@ def run_specific(pport, dockername):
     if intval == -1:
         print('-1')
         sys.exit()
-
+    db.close()
 
 class JParams(object):
     

+ 1 - 1
INNNews/run_sns.py

@@ -40,7 +40,7 @@ def run_once(pport, dockername):
     if intval == -1:
         print('-1')
         sys.exit()
-
+    db.close()
 
 class JParams(object):
     

+ 3 - 3
INNNews/sns_clickbot.py

@@ -22,8 +22,6 @@ import fire
 #pymysql.install_as_MySQLdb()
 
 
-db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/seo?charset=utf8mb4')
-table=db['sns_log']
 driver = None
 
 
@@ -48,6 +46,8 @@ def empty_query(q):
 
 
 def process_query(qs):
+    db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/seo?charset=utf8mb4')
+    table=db['sns_log']
     q=qs[0]
     url=qs[1]
     client=qs[2]
@@ -80,7 +80,7 @@ def process_query(qs):
                 time.sleep(5)
                 break
         idx+=1
-
+    db.close()
 def run_once(q):
     global driver
     s = Service('/root/driver/chromedriver')