notifyall.py 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import redis
  2. import time
  3. import json
  4. from selenium import webdriver
  5. from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
  6. import time
  7. import os
  8. import urllib.parse
  9. from selenium.webdriver.support.ui import WebDriverWait
  10. from selenium.webdriver.common.by import By
  11. from selenium.webdriver.support import expected_conditions as EC
  12. import codecs
  13. import random
  14. import requests
  15. import dataset
  16. import time
  17. import sys
  18. import docker
  19. import pymysql
  20. pymysql.install_as_MySQLdb()
  21. from GA_all import main
  22. ga_info = {'有夠讚':['208868237',{
  23. "Authorization": "Bearer " + "Alur8iUgifYsh9CMiyUdlrTWK4Y9Xys8RZD52YkBMGl",
  24. "Content-Type": "application/x-www-form-urlencoded"
  25. },'c:\gitlab\kw_tools\monitor\corded-velocity-301807-a0d690cd59d9.json'],
  26. '新飛':['195216524',{"Authorization": "Bearer " + "ZfOUonutteqyFGfcx8jsHo9LoaTKL8oJ3WLwQamzN6c",
  27. "Content-Type": "application/x-www-form-urlencoded"},'C:\gitlab\kw_tools\monitor\corded-velocity-301807-f43006dd42c8.json'],
  28. '極簡乳清':['141324760',{"Authorization": "Bearer " + "DC7eiXkGoKzXcuCTuqCGmuNnDC15D3iv6E7tu5BAsUZ",
  29. "Content-Type": "application/x-www-form-urlencoded"},'C:\gitlab\kw_tools\monitor\corded-velocity-301807-879b27e60620.json'],
  30. '美麗馨':['282939758',{"Authorization": "Bearer " + "4RO6ZOS4b7TkuqknajBPibTnOYnumHfwJvRzdZ3Bmq6",
  31. "Content-Type": "application/x-www-form-urlencoded"},'C:\gitlab\kw_tools\monitor\corded-velocity-301807-c1a87c5dfc8d.json'],
  32. }
  33. def send_msg(viewid,header,key_file):
  34. send_message = main(viewid, key_file)
  35. params = {"message": send_message['message']}
  36. print('通知結果',params)
  37. r = requests.post("https://notify-api.line.me/api/notify",headers=header, params=params)
  38. # for k,v in ga_info.items():
  39. # send_msg(v[0],v[1],v[2])
  40. send_msg('195216524',{"Authorization": "Bearer " + "DC7eiXkGoKzXcuCTuqCGmuNnDC15D3iv6E7tu5BAsUZ",
  41. "Content-Type": "application/x-www-form-urlencoded"},"C:\/Users\/s1301\/Downloads\/corded-velocity-301807-f43006dd42c8.json")
  42. # schtasks /create /sc minute /mo 30 /sd 2022/05/050 /st 9:00 /et 23:00 /tn "linebat" /tr "C:\tmp\inn_line.bat"
  43. SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
  44. sys.path.append(os.path.dirname(SCRIPT_DIR))