This is a really micro Tweet Sentiment Analyser that checks for negative tweets to a particular handle most likely yours and sends them to your slack channel for you to take action.
- Create a new project on your google cloud dashboard This is assuming you have GCP all set up.
- Enable the Google Cloud Natural Language API
- Click on Credentials and create a new API key
- Create a new slack app
- Select Incoming Webhooks and activate it
- Click on Add new webhook to team
- Select channel to post messages to and click on Authorize when done.
- Copy the generated Webhook URL to a safe place.
- Sign up to webtask.io and create a new empy function on your dashboard.
- Copy over the code from the app.js file into your new function
- You'd have to create two new secrets
- nlpApiKey: which contains the api key for the nlp api
- slackWebhookURL: Slack webhook api url
- Create a new IFTT applet
- Search and select Twitter
- Select the New mention of you card on the next page
- Search and select the WebHooks service
- Select the Make a web request
- In the URL section enter
[WEBTASK_URL]?text=<<<{{Text}}>>>&from=<<<{{UserName}}>>>&url=<<<{{LinkToTweet}}>>>
where [WEBTASK_URL] is the Url generated for your function by webtask.io and make sure the method is set to GET.