12345678910111213141516171819202122232425262728293031323334 |
- 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')
|