Example 3: notify me if I won’t have water at home
My local water service periodically tweets streets that are going to be without water supply. These are always a list of streets that won’t have service. Since I can’t be constantly monitoring this service, so this automation below notifies me via email if my street name is mentioned in the tweet.
Applet 1:
- If my local water supply service tweets
- Trigger service: Twitter
- Trigger: New tweet by specific user
- Then store the tweet in a string variable
Applet 2
- If my local water supply service tweets
- Trigger service: Twitter
- Trigger: New tweet by specific user
- And only if the tweet mentions ‘Regent Street’
- Query service: Apilio
- Query: History of string variable ‘water_tweet’
- Filter code
let str = Apilio.historyOfAVariableFromApilio.Value; let searchTerm = 'Regent Street'; let indexOfFirst = str.indexOf(searchTerm); if (indexOfFirst === -1) { Email.sendMeEmail.skip("Tweet wasn't about Regent Street") }`
- Then notify me
- Action service: email
- Action: email me with the tweet