Jared 2 éve
szülő
commit
f2a9eb8a91
1 módosított fájl, 15 hozzáadás és 3 törlés
  1. 15 3
      INNNews/routine_click.py

+ 15 - 3
INNNews/routine_click.py

@@ -19,11 +19,23 @@ import sys
 import fire
 #from INNNews import notifytest
 
+
+probdict={}
+probdict[0]={'client':'hhh','domain':'hhh.com.tw'}
+probdict[1]={'client':'毛怪','domain':'beastparadise.net'}
+probdict[2]={'client':'清原','domain':'taroboba-yuan.com'}
+
 db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/seo?charset=utf8mb4')
+
+prob=[0,0,0,0,1,1,2,2]
+idx=random.choice(prob)
+
+client=probdict[idx]['client']
+domain=probdict[idx]['domain']
+
 term=None
-domain='hhh.com.tw'
 address="192.168.192.45:9922"
-cursor=db.query('SELECT term FROM seo.selected_kw where client = "hhh" order by rand() limit 1')
+cursor=db.query('SELECT term FROM seo.selected_kw where client = "'+client+'" order by rand() limit 1')
 for c in cursor:
     term=c['term']
     break
@@ -35,6 +47,6 @@ else:
 
 
 
-os.system(py+' general_remote_click.py get --kw="'+term+'" --domain='+domain+' --address="'+address+'"')
+os.system(py+' general_remote_click.py get --kw="'+term+'" --domain='+domain+' --address="'+address+'" --epath="C:/portable/webdriver/chrome98/chromedriver.exe"')