Jason hai 1 ano
pai
achega
29e1f1c4ff

+ 43 - 1
website_clickjobs/type-GD/_clickjob.py

@@ -149,4 +149,46 @@ def execute(url, cust, query):
     print("Ctrl+C or Ctrl+Z to stop now.")
     print("You have " + str(10 + extrasleep) + " seconds.")
     time.sleep(10 + extrasleep)
-    return statuscode
+    return statuscode
+
+def reset(client):
+    ds=db.query('select * from seo.seo_articles where cust="' + client + '"')
+    #TAG ABOVE AND UNTAG BELOW FOR DEBUG
+    #ds=hhhdb.query('select * from seo.seo_articles where cust=')
+    data=[]
+    for i in ds:
+        if i['weight']!=0:
+            for j in range(i['weight']):
+                data.append([i['kw'].replace('\xa0',' '),i['cust'].replace('\xa0',' '),i['url']])
+    random.shuffle(data)
+    return data
+
+def run(client):
+    runcount=0
+    while True:
+        try:
+            print("Gathering data...")
+            data = reset(client)
+            print('Data collected')
+            dataok = 1
+        except:
+            dataok = 0
+            print("Error while collecting data.")
+        if dataok == 1:
+            for i in range(10):
+                print("Run " + str(runcount+1))
+                target = random.choice(data) # START HERE
+                target_kw = target[0]
+                cust = target[1]
+                target_url = target[2]
+                print(target_kw)
+                print(cust)
+                print(target_url)
+                statuscode = execute(target_url, cust, target_kw)
+                if statuscode == 444:
+                    print("Completed ", runcount, " times before being caught")
+                    time.sleep(300)
+                else:
+                    runcount+=1
+        else:
+            time.sleep(60)

+ 2 - 40
website_clickjobs/type-GD/icons.py

@@ -1,44 +1,6 @@
 from _clickjob import *
 
 db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/seo?charset=utf8mb4')
+client = 'The Icons'
 
-def reset():
-    ds=db.query('select * from seo.seo_articles where cust="The Icons"')
-    #TAG ABOVE AND UNTAG BELOW FOR DEBUG
-    #ds=hhhdb.query('select * from seo.seo_articles where cust=')
-    data=[]
-    for i in ds:
-        for j in range(i['weight']):
-            data.append([i['kw'].replace('\xa0',' '),i['cust'].replace('\xa0',' '),i['url']])
-    random.shuffle(data)
-    return data
-
-#data = getdata()
-
-runcount=0
-while True:
-    try:
-        print("Gathering data...")
-        data = reset()
-        print('Data collected')
-        dataok = 1
-    except:
-        dataok = 0
-        print("Error while collecting data.")
-    if dataok == 1:
-        for i in range(10):
-            print("Run " + str(runcount+1))
-            target = random.choice(data) # START HERE
-            target_kw = target[0]
-            target_url = target[2]
-            print(target_kw)
-            print(target_url)
-            statuscode = execute(target_url, target_kw)
-            if statuscode == 444:
-                print("Completed ", runcount, " times before being caught")
-                time.sleep(300)
-            else:
-                runcount+=1
-                time.sleep(40)
-    else:
-        time.sleep(60)
+run(client)

+ 2 - 41
website_clickjobs/type-GD/kiesthee.py

@@ -1,45 +1,6 @@
 from _clickjob import *
 
 db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/seo?charset=utf8mb4')
+client = '老茶滴雞精'
 
-def reset():
-    ds=db.query('select * from seo.seo_articles where cust="老茶滴雞精"')
-    #TAG ABOVE AND UNTAG BELOW FOR DEBUG
-    #ds=hhhdb.query('select * from seo.seo_articles where cust=')
-    data=[]
-    for i in ds:
-        for j in range(i['weight']):
-            data.append([i['kw'].replace('\xa0',' '),i['cust'].replace('\xa0',' '),i['url']])
-    random.shuffle(data)
-    return data
-
-#data = getdata()
-
-runcount=0
-while True:
-    try:
-        print("Gathering data...")
-        data = reset()
-        print('Data collected')
-        dataok = 1
-    except:
-        dataok = 0
-        print("Error while collecting data.")
-    if dataok == 1:
-        for i in range(10):
-            print("Run " + str(runcount+1))
-            target = random.choice(data) # START HERE
-            target_kw = target[0]
-            cust = target[1]
-            target_url = target[2]
-            print(target_kw)
-            print(cust)
-            print(target_url)
-            statuscode = execute(target_url, cust, target_kw)
-            if statuscode == 444:
-                print("Completed ", runcount, " times before being caught")
-                time.sleep(300)
-            else:
-                runcount+=1
-    else:
-        time.sleep(60)
+run(client)

+ 2 - 41
website_clickjobs/type-GD/yours.py

@@ -1,45 +1,6 @@
 from _clickjob import *
 
 db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/seo?charset=utf8mb4')
+client = '優思整合顧問'
 
-def reset():
-    ds=db.query('select * from seo.seo_articles where cust="優思整合顧問"')
-    #TAG ABOVE AND UNTAG BELOW FOR DEBUG
-    #ds=hhhdb.query('select * from seo.seo_articles where cust=')
-    data=[]
-    for i in ds:
-        for j in range(i['weight']):
-            data.append([i['kw'].replace('\xa0',' '),i['cust'].replace('\xa0',' '),i['url']])
-    random.shuffle(data)
-    return data
-
-#data = getdata()
-
-runcount=0
-while True:
-    try:
-        print("Gathering data...")
-        data = reset()
-        print('Data collected')
-        dataok = 1
-    except:
-        dataok = 0
-        print("Error while collecting data.")
-    if dataok == 1:
-        for i in range(10):
-            print("Run " + str(runcount+1))
-            target = random.choice(data) # START HERE
-            target_kw = target[0]
-            cust = target[1]
-            target_url = target[2]
-            print(target_kw)
-            print(cust)
-            print(target_url)
-            statuscode = execute(target_url, cust, target_kw)
-            if statuscode == 444:
-                print("Completed ", runcount, " times before being caught")
-                time.sleep(300)
-            else:
-                runcount+=1
-    else:
-        time.sleep(60)
+run(client)