added posting in main
parent
6da973f37b
commit
3de814d893
|
|
@ -82,14 +82,23 @@ 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": "AdaptiveCard",
|
||||
"body": [
|
||||
{
|
||||
"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 = {
|
||||
# keep text for flows that read triggerBody()['text']
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue