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