You can also connect to the sampled stream endpoint using one of our code samples
Once connected, you will continually receive Tweets as they are posted. As Tweets are received on the endpoint, you can programmatically scan for and keep count of repeat occurrences of hashtags, user mentions, keywords and Annotations in a key-value store or another data store.
Trigger actions or notifications based on the Tweets of interest that you listen for
Once you have the Tweets of interest, you can decide what to do next with them. You may want to notify using a certain channel (e.g. sending an email, sending an SMS, or sending a notification to a communication app etc.) with links to the Tweets of interest.
Sending an email with the Tweet data
In order to programmatically send links to Tweets in an email, you will need to use an email service. Some examples of such services include the SendGrid Email API, AWS Simple Email Service (SES) etc. These services generally provide SDKs that make it easy for you to get started. They generally require you to verify your email addresses (to & from) and you can pass the URLs to the Tweets in the body.
Sending an SMS with the Tweet data
Your use-case may require sending the links to Tweets using SMS. Some services that let you send SMS programmatically include Twilio, AWS Simple Notification Service (SNS) etc. These services also provide SDKs that you can use in your code to get started. Twilio provides you with a phone number that you can send SMS from and you can use the URLs to the Tweets as the message body.
Sending a notification to a communication tools
You may want to send the links of Tweets to a communication tool that you might be using. Communication tools such as Slack, Discord etc. have APIs that let you send messages to channels on those apps. You may first have to create an app on those communication tools and obtain webhook urls to send messages to. Once you have the app created (and have the webhooks etc.) you can send the links to Tweets to the channels of your choice.
Note: If for your use-case, you do not want to be notified for events instantaneously as they happen, you can also use the Recent Search endpoint and call it periodically. Then, after you get data from this endpoint, you can decide on how to notify the right channels.
For an example of building a service that listens for breaking news using the filtered stream endpoint and sends notifications via Slack or SMS, check out this tutorial. This app does not require any custom coding and can be deployed to AWS.