Eddie
2 years ago
3 changed files with 12 additions and 20 deletions
@ -1,19 +1,3 @@ |
|||||||
import requests, os |
import subprocess |
||||||
from dotenv import load_dotenv |
|
||||||
load_dotenv() |
|
||||||
pw = os.getenv('BOT') |
|
||||||
|
|
||||||
headers = { |
subprocess.call(['sh','./sender.sh', 'Aus Python']) |
||||||
|
|
||||||
'Content-Type': 'application/json', |
|
||||||
|
|
||||||
'Accept': 'application/json', |
|
||||||
|
|
||||||
'OCS-APIRequest': 'true', |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
data = '{"token": "xzntzmuh", "message": "test"}' |
|
||||||
|
|
||||||
response = requests.post('https://cloud1.sommerschein.de/ocs/v2.php/apps/spreed/api/v1/chat/xzntzmuh', headers=headers, data=data, auth=('Maily', 'pw')) |
|
||||||
print(response.content) |
|
@ -0,0 +1,7 @@ |
|||||||
|
#!/bin/bash |
||||||
|
|
||||||
|
API=https://cloud1.sommerschein.de/ocs/v1.php/apps/spreed/api/v1/chat/xzntzmuh |
||||||
|
LOGIN="Maily:Gtjik-qP48b-y62bC-r8yos-qJT9Y" |
||||||
|
MESSAGE=$1 |
||||||
|
|
||||||
|
curl -d '{"token":"xzntzmuh", "message":"'"$MESSAGE"'"}' -H "Content-Type: application/json" -H "Accept:application/json" -H "OCS-APIRequest:true" -u "$LOGIN" $API 2> /dev/null | > /dev/null |
Loading…
Reference in new issue