Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Auto tweeting logic app
{
"$connections": {
"value": {
"rss": {
"connectionId": "/subscriptions/7e2b0a07-47db-4a2e-bfca-03c0d5b75f15/resourceGroups/personal-website/providers/Microsoft.Web/connections/rss",
"connectionName": "rss",
"id": "/subscriptions/7e2b0a07-47db-4a2e-bfca-03c0d5b75f15/providers/Microsoft.Web/locations/southcentralus/managedApis/rss"
},
"twitter": {
"connectionId": "/subscriptions/7e2b0a07-47db-4a2e-bfca-03c0d5b75f15/resourceGroups/personal-website/providers/Microsoft.Web/connections/twitter",
"connectionName": "twitter",
"id": "/subscriptions/7e2b0a07-47db-4a2e-bfca-03c0d5b75f15/providers/Microsoft.Web/locations/southcentralus/managedApis/twitter"
}
}
},
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Delay": {
"inputs": {
"interval": {
"count": 12,
"unit": "Hour"
}
},
"runAfter": {
"For_each": [
"Succeeded"
]
},
"type": "Wait"
},
"For_each": {
"actions": {
"Post_a_tweet": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['twitter']['connectionId']"
}
},
"method": "post",
"path": "/posttweet",
"queries": {
"tweetText": "I just blogged: @{triggerBody()?['title']} @{items('For_each')} #@{body('Hashtagged_Categories')}"
}
},
"runAfter": {},
"type": "ApiConnection"
}
},
"foreach": "@triggerBody()?['links']",
"runAfter": {
"Hashtagged_Categories": [
"Succeeded"
]
},
"type": "Foreach"
},
"For_each_delay": {
"actions": {
"Post_a_tweet_delay": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['twitter']['connectionId']"
}
},
"method": "post",
"path": "/posttweet",
"queries": {
"tweetText": "ICYMI: I blogged: @{triggerBody()?['title']} @{items('For_each_delay')} @{body('Hashtagged_Categories')}"
}
},
"runAfter": {},
"type": "ApiConnection"
}
},
"foreach": "@triggerBody()?['links']",
"runAfter": {
"Delay": [
"Succeeded"
]
},
"type": "Foreach"
},
"Hashtagged_Categories": {
"inputs": {
"from": "@triggerBody()?['categories']",
"joinWith": " #"
},
"runAfter": {},
"type": "Join"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {
"$connections": {
"defaultValue": {},
"type": "Object"
}
},
"triggers": {
"When_a_feed_item_is_published": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['rss']['connectionId']"
}
},
"method": "get",
"path": "/OnNewFeed",
"queries": {
"feedUrl": "https://www.aaron-powell.com/index.xml"
}
},
"recurrence": {
"frequency": "Minute",
"interval": 3
},
"splitOn": "@triggerBody()?['value']",
"type": "ApiConnection"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.