commerce.py 715 B

123456789101112131415161718192021222324252627282930
  1. import sys
  2. import codecs
  3. import traceback
  4. import requests
  5. import re
  6. import pandas as pd
  7. import random
  8. import urllib
  9. import json
  10. import gspread
  11. import datetime
  12. from gspread_pandas import Spread, Client
  13. from oauth2client.service_account import ServiceAccountCredentials
  14. import os
  15. import redis
  16. import dataset
  17. db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/seo?charset=utf8mb4')
  18. domain='beastparadise.net'
  19. cursor=db.query('SELECT term FROM seo.selected_kw where domain = "'+domain+'" order by rand()')
  20. kw={}
  21. for c in cursor:
  22. kw['kw']=c['term']
  23. print(kw['kw'])
  24. if os.name == 'nt':
  25. py='python'
  26. else:
  27. py='python3'
  28. os.system(py+' general_clickbot.py get --kw="'+kw['kw']+'" --domain='+domain)