Explorar o código

更新 'monitor/GA_Daily.py'

miacheng913 %!s(int64=3) %!d(string=hai) anos
pai
achega
4c3a2bf9a4
Modificáronse 1 ficheiros con 3 adicións e 6 borrados
  1. 3 6
      monitor/GA_Daily.py

+ 3 - 6
monitor/GA_Daily.py

@@ -38,9 +38,9 @@ headers = {
 
 com_table = []
 def creat_table():
-  for i in range(0,24):
+  for i in range(0,23):
     com_table.append([i,2300*i])
-  com_table.append([24,56000])
+  com_table.append([23,56000])
   print(com_table)
 
 def send_msg(kw):
@@ -50,13 +50,10 @@ def send_msg(kw):
     # 判斷是否達標
     complet="否"
     for i in range(0,25):
-      if int(hour)+1==com_table[i][0]:
+      if int(hour)==com_table[i][0]:
         print(i)
         if int(kw) > com_table[i][1] : 
           complet="是"
-      elif int(hour) == 24:
-        if int(kw) > 56000 : 
-          complet="是"
     params = {"message": "\n現在時間: " + current_time + "\n當前pageViews: "+kw + "\n是否達標: " + complet}  
     print(params)
     r = requests.post("https://notify-api.line.me/api/notify",headers=headers, params=params)