Feed chat webhook prototype
This commit is contained in:
commit
a260c318af
21
feed_chat_webhook/__main__.py
Normal file
21
feed_chat_webhook/__main__.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
from json import dumps
|
||||
import requests
|
||||
import secrets_loader
|
||||
|
||||
secrets = secrets_loader.SecretsLoader()
|
||||
|
||||
WEBHOOK_URL = secrets.load_or_fail('WEBHOOK_URL')
|
||||
|
||||
def main():
|
||||
"""Google Chat incoming webhook quickstart."""
|
||||
app_message = {"text": "Hello from a Python script!"}
|
||||
message_headers = {"Content-Type": "application/json; charset=UTF-8"}
|
||||
response = requests.post(
|
||||
WEBHOOK_URL,
|
||||
headers=message_headers,
|
||||
json=app_message,
|
||||
)
|
||||
print(response)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Loading…
Reference in New Issue
Block a user