LoginSignup
1
1

More than 1 year has passed since last update.

PythonでLINE Notifyへ通知を送る

Posted at

ここからアカウントを登録してトークンを取得します。
https://notify-bot.line.me/ja/

ターミナルからrequestsをインストールしておく

hoge.py
pip install requests
hoge.py
import requests


# LINEに通知させる関数
def line_notify(message):
    token = 'XF8fj16T**************dcqqS9CXOa'
    url = "https://notify-api.line.me/api/notify"
    headers = {"Authorization": "Bearer " + token}
    payload = {"message": message}
    requests.post(url, headers=headers, params=payload)

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1