Skip to content

Instantly share code, notes, and snippets.

@kenichimiki
Created July 24, 2019 05:54
Show Gist options
  • Save kenichimiki/59895f807df73396f0ccc59812c7e6dd to your computer and use it in GitHub Desktop.
Save kenichimiki/59895f807df73396f0ccc59812c7e6dd to your computer and use it in GitHub Desktop.
import urllib.request
#params for IFTTT
ifttt_api_key = '/with/key/@アクセスキー@'
url_base = 'https://maker.ifttt.com/trigger/'
#EVENT name for IFTTT
ifttt_event = 'test'
url = url_base + ifttt_event + ifttt_api_key
params = {'value1': 123,'value2': 123,'value3': 123,}
req = urllib.request.Request('{}?{}'.format(url, urllib.parse.urlencode(params)))
with urllib.request.urlopen(req) as res:
body = res.read()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment