Depression
This commit is contained in:
parent
a9e91563f2
commit
4e826e8e0e
1 changed files with 3 additions and 3 deletions
6
chat.py
6
chat.py
|
@ -8,7 +8,7 @@ from datetime import datetime
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
import mpd
|
import mpd
|
||||||
from urllib.parse import urlencode
|
from urllib.parse import urlencode
|
||||||
from urllib.request import Request, urlopen
|
import urllib.request
|
||||||
import base64
|
import base64
|
||||||
|
|
||||||
mpc = mpd.MPDClient()
|
mpc = mpd.MPDClient()
|
||||||
|
@ -93,8 +93,8 @@ def messages_post():
|
||||||
url = 'http://10.0.5.42:8000/' # Set destination URL here
|
url = 'http://10.0.5.42:8000/' # Set destination URL here
|
||||||
post_fields = {'X-Messages': base64.b64encode(message)} # Set POST fields here
|
post_fields = {'X-Messages': base64.b64encode(message)} # Set POST fields here
|
||||||
|
|
||||||
request = Request(url, urlencode(post_fields).encode())
|
request = urllib.request.Request(url, urlencode(post_fields).encode())
|
||||||
json = urlopen(request).read().decode()
|
json = urllib.request.urlopen(request).read().decode()
|
||||||
speak(message)
|
speak(message)
|
||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
|
|
Loading…
Reference in a new issue