Skip to content

Instantly share code, notes, and snippets.

@amaotone
Last active September 23, 2018 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amaotone/2eea52379d559a4dc60e6c6c76085b7b to your computer and use it in GitHub Desktop.
Save amaotone/2eea52379d559a4dc60e6c6c76085b7b to your computer and use it in GitHub Desktop.
LINEに通知を送るやつ。API tokenの発行は https://notify-bot.line.me/my/ から。
def notify(message):
assert type(message) is str
token = YOUR_ACCESS_TOKEN # deactivate when the competition is over
api = 'https://notify-api.line.me/api/notify'
message = "\n" + message
payload = {'message': message}
headers = {'Authorization': 'Bearer {}'.format(token)}
requests.post(api, data=payload, headers=headers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment