Explorar o código

上傳檔案到 'ifttt'

fatwolf %!s(int64=3) %!d(string=hai) anos
pai
achega
22fcbfae82
Modificáronse 1 ficheiros con 39 adicións e 0 borrados
  1. 39 0
      ifttt/ifttt_test0.py

+ 39 - 0
ifttt/ifttt_test0.py

@@ -0,0 +1,39 @@
+import requests as req
+from urllib import parse
+
+import datetime
+import os
+
+x = 2
+
+def ifttt():
+    evt = 'notify_me'   # 事件名稱
+    key = 'c3xo5EvpBX64fPEqxphcR4jBTzDh1r2joTDsB_BslOA'
+    val1 = parse.quote(str(x))  # value1參數值
+    val2 = parse.quote('open')  # value1參數值
+    val3 = parse.quote('forget')  # value1參數值
+
+    url = (f'https://maker.ifttt.com/trigger/{evt}' +
+           f'/with/key/{key}?value1={val1}&value2={val2},&value3={val3}')
+
+    r = req.get(url)  # 執行IFTTT平台的webhooks
+    r.text   # 取得IFTTT的回應
+
+ifttt()
+os.system(ifconfig)
+
+'''
+    evt = 'notify_me'  # 事件名稱
+    key = 'c3xo5EvpBX64fPEqxphcR4jBTzDh1r2joTDsB_BslOA'
+    val1 = parse.quote('執行第')  # value1參數值
+    val2 = parse.quote(str(x))  # value2參數值
+    val3 = parse.quote('次')  # value3參數值
+
+    url = (f'https://maker.ifttt.com/trigger/{evt}' +
+           f'/with/key/{key}?value1={val1}&value2={val2}&value3={val3}')
+
+    r = req.get(url)  # 執行IFTTT平台的webhooks
+    r.text  # 取得IFTTT的回應
+    x = x+1
+    '''
+