1234567891011121314151617181920212223242526272829303132333435 |
- import sys
- import codecs
- import traceback
- import requests
- import re
- import pandas as pd
- import random
- import urllib
- import json
- import os
- import redis
- import time
- r = redis.Redis(host='db.ptt.cx', port=6379, db=1,password='choozmo9')
- js=r.get('innews_sheet')
- jsobj=json.loads(js)
- while True:
- kw=random.choice(jsobj) # 第一次(三組關鍵字)
-
- kw_innews = '引新聞 ' # 第二次(隨機選擇兩組關鍵字與引新聞)
- num = random.choices([0,1,2],k=2)
- for i in num:
- kw_innews+=kw['kw'].split(' ')[i]+' '
- print(kw)
-
-
- # os.chdir('/Users/zooeytsai/kw_tools/INNNews')
- print('python3 general_clickbot.py get --kw="'+kw['kw']+'" --domain=innews.com.tw')
- os.system('python general_clickbot_local.py get --kw="'+kw['kw']+'" --domain=innews.com.tw')
- print('等待')
- time.sleep(120)
- # time.sleep(120)
- # os.system('python3 general_clickbot.py get --kw="'+kw_innews+'" --domain=innews.com.tw')
- # os.system('python notifytest.py send_msg')
|