-
-
Save track3jyo-hama/9e848e2eb583bc8a1fc6c9604cc6a2b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Comment": "A description of my state machine", | |
"StartAt": "Map", | |
"States": { | |
"Map": { | |
"Type": "Map", | |
"ItemProcessor": { | |
"ProcessorConfig": { | |
"Mode": "INLINE" | |
}, | |
"StartAt": "Base64デコード& String to Json", | |
"States": { | |
"Base64デコード& String to Json": { | |
"Type": "Pass", | |
"Next": "ツイートの感情分析", | |
"Parameters": { | |
"data.$": "States.StringToJson(States.Base64Decode($.data))" | |
} | |
}, | |
"ツイートの感情分析": { | |
"Type": "Task", | |
"Parameters": { | |
"LanguageCode": "ja", | |
"Text.$": "$.data.body" | |
}, | |
"Resource": "arn:aws:states:::aws-sdk:comprehend:detectSentiment", | |
"ResultSelector": { | |
"Sentiment.$": "$.Sentiment" | |
}, | |
"ResultPath": "$.TaskResult", | |
"Comment": "感情分析", | |
"Next": "ネガティヴツイートの分岐" | |
}, | |
"ネガティヴツイートの分岐": { | |
"Type": "Choice", | |
"Choices": [ | |
{ | |
"Variable": "$.TaskResult.Sentiment", | |
"StringEquals": "NEGATIVE", | |
"Next": "でもそこが好き...♡" | |
} | |
], | |
"Default": "そのままツイートしちゃえ!" | |
}, | |
"でもそこが好き...♡": { | |
"Type": "Pass", | |
"End": true, | |
"Parameters": { | |
"name.$": "$.data.name", | |
"twitter_id.$": "$.data.twitter_id", | |
"created_at.$": "$.data.created_at", | |
"body.$": "States.Format('{} \n でもそこが好き...♡!', $.data.body)" | |
} | |
}, | |
"そのままツイートしちゃえ!": { | |
"Type": "Pass", | |
"End": true, | |
"Parameters": { | |
"name.$": "$.data.name", | |
"twitter_id.$": "$.data.twitter_id", | |
"created_at.$": "$.data.created_at", | |
"body.$": "$.data.body" | |
} | |
} | |
} | |
}, | |
"End": true, | |
"MaxConcurrency": 5 | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment