|
@@ -0,0 +1,84 @@
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+import os
|
|
|
+from typing import Optional
|
|
|
+from dataset.util import ResultIter
|
|
|
+from datetime import tzinfo
|
|
|
+import datetime
|
|
|
+import mysql.connector
|
|
|
+from mysql.connector import Error
|
|
|
+import dataset
|
|
|
+import json
|
|
|
+from pytube import extract
|
|
|
+import requests
|
|
|
+import json
|
|
|
+
|
|
|
+hhhMBPath = '../hhh-home-mb'
|
|
|
+hhhPCPath = '../hhh-home-pc'
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+connstr = 'mysql://hhh7796hhh:lYmWsu^ujcA1@ec2-3-35-26-49.ap-northeast-2.compute.amazonaws.com:3306/xoops?charset=utf8mb4'
|
|
|
+
|
|
|
+""" db = dataset.connect(
|
|
|
+ 'mysql://hhh7796hhh:lYmWsu^ujcA1@hhh-v57.cmab1ctkglka.ap-northeast-2.rds.amazonaws.com:3306/xoops?charset=utf8mb4') """
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+connobj = {
|
|
|
+ 'host': 'ec2-3-35-26-49.ap-northeast-2.compute.amazonaws.com',
|
|
|
+ 'database': 'xoops',
|
|
|
+ 'user': 'hhh7796hhh',
|
|
|
+ 'password': 'lYmWsu^ujcA1',
|
|
|
+ 'use_unicode': True
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+while True:
|
|
|
+ try:
|
|
|
+ a=requests.get('https://m3.hhh.com.tw:18673/designer_keyword')
|
|
|
+ break
|
|
|
+ except:
|
|
|
+ time.sleep(5)
|
|
|
+
|
|
|
+d=a.json()
|
|
|
+print(d)
|
|
|
+with open('../json/designer_keyword.json','w+',encoding="utf-8") as f:
|
|
|
+ json.dump(d, f)
|
|
|
+
|
|
|
+cmd="""curl -X POST "https://api.cloudflare.com/client/v4/zones/8cb58022ad5743cfd9f088d5e3a261eb/purge_cache" -H "X-Auth-Email: web.dept.hhh@gmail.com" -H "X-Auth-Key:63e51d9a1638d66afcbfc3320aabec52304de" -H "Content-Type: application/json" --data '{"files":["https://hhh.com.tw/hhh-test/json/designer_keyword.json"]}'"""
|
|
|
+print(cmd)
|
|
|
+os.system(cmd)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|