|
@@ -28,8 +28,6 @@ from userAgentRandomizer import userAgents
|
|
|
pymysql.install_as_MySQLdb()
|
|
|
driver=None
|
|
|
|
|
|
-db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/seo?charset=utf8mb4')
|
|
|
-
|
|
|
headers = {
|
|
|
"Authorization": "Bearer " + "6SDULL1Ebklduc6TFxa97AFto5Sj21kyJ30CxiLiSoi",
|
|
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
@@ -201,6 +199,7 @@ def run_once(jsobj):
|
|
|
|
|
|
while True:
|
|
|
try:
|
|
|
+ db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/seo?charset=utf8mb4')
|
|
|
cursor=db.query('select json from seo.seo_jobs where cust="啟翔" and plan="形象SEO" and json like "%陳百欽%" order by rand() limit 1')
|
|
|
for c in cursor:
|
|
|
js=json.loads(c['json'])
|
|
@@ -241,4 +240,5 @@ while True:
|
|
|
pass
|
|
|
cursor=None
|
|
|
driver=None
|
|
|
+ db.close()
|
|
|
time.sleep(20)
|