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 redis import dataset db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/seo?charset=utf8mb4') domain='beastparadise.net' cursor=db.query('SELECT term FROM seo.selected_kw where domain = "'+domain+'" order by rand()') kw={} for c in cursor: kw['kw']=c['term'] print(kw['kw']) if os.name == 'nt': py='python' else: py='python3' os.system(py+' general_clickbot.py get --kw="'+kw['kw']+'" --domain='+domain)