added posting in main

main
Ebbe Baß 2025-10-29 13:51:52 +01:00
parent 6da973f37b
commit 3de814d893
1 changed files with 18 additions and 8 deletions

View File

@ -82,14 +82,23 @@ def post_to_teams(quote):
headers = {"Content-Type": "application/json"} headers = {"Content-Type": "application/json"}
adaptive_card = { adaptive_card = {
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "type": "AdaptiveCard",
"type": "AdaptiveCard", "body": [
"version": "1.2", {
"body": [ "type": "TextBlock",
{"type": "TextBlock", "size": "Medium", "weight": "Bolder", "text": "Daily Quote"}, "size": "Medium",
{"type": "TextBlock", "wrap": False, "text": quote} "weight": "Bolder",
] "text": "${title}"
} },
{
"type": "TextBlock",
"text": quote,
"wrap": True
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.6"
}
payload = { payload = {
# keep text for flows that read triggerBody()['text'] # keep text for flows that read triggerBody()['text']
@ -124,4 +133,5 @@ def post_to_teams(quote):
if __name__ == "__main__": if __name__ == "__main__":
# Fetch a quote and post it to Teams. Use env vars to override defaults. # Fetch a quote and post it to Teams. Use env vars to override defaults.
quote = get_quote() quote = get_quote()
post_to_teams(quote)
print("Quote fetched:", quote) print("Quote fetched:", quote)