Explorar o código

line seo通知增加hhh設計師

zooeytsai %!s(int64=2) %!d(string=hai) anos
pai
achega
6c8437a2b7
Modificáronse 1 ficheiros con 5 adicións e 3 borrados
  1. 5 3
      SEO/seo_notify.py

+ 5 - 3
SEO/seo_notify.py

@@ -27,7 +27,7 @@ headers = {
     "Content-Type": "application/x-www-form-urlencoded"
 }
 
-name = {'beastparadise.net':'毛怪','taroboba-yuan.com':'清原','match-planet.com':'火柴星人','hhh.com.tw':'幸福空間','sctt.com.tw':'仁本'}
+name = {'beastparadise.net':'毛怪','taroboba-yuan.com':'清原','match-planet.com':'火柴星人','hhh.com.tw':['幸福空間','幸福空間設計師'],'sctt.com.tw':'仁本'}
 
 def send_msg(kw):
     params = {"message": kw}
@@ -40,10 +40,12 @@ cursor = db.query(
     'SELECT * FROM seo.general_log where domain != "innews.com.tw" and datediff(now(),dt)=0 order by dt desc')
 result = "\n"
 idx = 0
-d = {'beastparadise.net':0,'match-planet.com':0,'taroboba-yuan.com':0,'hhh.com.tw':0,'sctt.com.tw':0}
+d = {'beastparadise.net':0,'match-planet.com':0,'taroboba-yuan.com':0,'hhh.com.tw':0,'sctt.com.tw':0,'hhh.com.tw/designer':0}
 for c in cursor:
     custom_name = c['domain']
     if custom_name in d:
+        if custom_name == 'hhh.com.tw' and c['num']=='s':
+            d['hhh.com.tw/designer']+=1
         d[custom_name]+=1
     idx += 1
     if idx <= 3:
@@ -52,7 +54,7 @@ for c in cursor:
         custom_name = name[domain]
         result += "[" + str(c['ranking']) + "]:" + elmt + " "+ f"({custom_name})\n"
 
-per_total_click = f"毛怪:{d['beastparadise.net']}\n清原:{d['taroboba-yuan.com']}\n火柴星人:{d['match-planet.com']}\n幸福空間:{d['hhh.com.tw']}\n仁本:{d['sctt.com.tw']}\n"
+per_total_click = f"毛怪:{d['beastparadise.net']}\n清原:{d['taroboba-yuan.com']}\n火柴星人:{d['match-planet.com']}\n幸福空間:{d['hhh.com.tw']}\n幸福空間設計師:{d['hhh.com.tw/designer']}\n仁本:{d['sctt.com.tw']}\n"
 print(per_total_click)
 msg_per_total_click = '\n點擊次數總計:\n' + per_total_click
 msg = "\n機器人執行次數:" + str(idx)