# Output a message from Raspberry Pi to Line. From Line Notify Select My Page. Get an access token.
Click Publish If you get a token
LineNotify.py
'''
Line Notify Test Program
'''
def LinePrint(msg):
import requests
token='{Obtained token}'
headers = {'Authorization': 'Bearer %s'%token, }
files = {'message': (None, msg),}
r = requests.post('https://notify-api.line.me/api/notify', headers=headers, files=files)
print(r,r.text)
LinePrint("\nhello world")
When you run You can skip messages to Line.
Recommended Posts