Selaa lähdekoodia

hhh每日爬kw

zooeytsai 3 vuotta sitten
vanhempi
commit
e4d09e622d
1 muutettua tiedostoa jossa 34 lisäystä ja 0 poistoa
  1. 34 0
      hhh/SEO/hhh_run_sheet.py

+ 34 - 0
hhh/SEO/hhh_run_sheet.py

@@ -0,0 +1,34 @@
+import sys
+import codecs
+import traceback
+import requests
+import re
+import pandas as pd
+import random
+import urllib
+import json
+import gspread
+import datetime
+from gspread_pandas import Spread, Client
+from oauth2client.service_account import ServiceAccountCredentials
+import os
+import time
+import dataset
+import pymysql
+pymysql.install_as_MySQLdb()
+
+db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/seo?charset=utf8mb4')
+sql = "SELECT * FROM seo.seo_clickjobs where category='hhh-faq'"
+cursor = db.query(sql)
+db.close()
+all_kw = []
+for c in cursor:
+    all_kw.append(c['kw'])
+print(all_kw)
+kw=random.choice(all_kw)
+print(kw)
+
+
+os.system('python general_clickbot.py get --kw="' + kw + '" --domain=hhh.com.tw')
+
+