티스토리 뷰

  • IFTTT를 통해 훅업 메시지 전송
  • 키 값이 필요함.

 

<Main Source>

            from BIFTTT import cBIFTTT
            cBIFTTT(param2)


<Method>

    def __init__(self, params):

        iFTTTKey = "KEY"
        activityName = "BilientService"
        value1 = params.get('Value1')
        value2 = params.get('Value2')
        value3 = params.get('Value3')

        url1 = "https://maker.ifttt.com/trigger/"+activityName+"/with/key/"+iFTTTKey
        data1 ={
            "value1": value1,
            "value2": value2,
            "value3": value3
        }
        print(url1)
        headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
        res1 = requests.post(url1, data=json.dumps(data1), headers=headers)
        print(res1.text)
반응형