Pack which allows integration with Twitter.
Copy the example configuration in twitter.yaml.example
to /opt/stackstorm/configs/twitter.yaml
and edit as required.
It should contain:
consumer_key
- Twitter API consumer key.consumer_secret
- Twitter API consumer secret.access_token
- Twitter API access token.access_token_secret
- Twitter API access token secret.query
- A query to search the twitter timeline for. Must be an array. By default OR is applied for array items, and you can refine your results further via rule criteria. You can use all the query operators described at https://dev.twitter.com/rest/public/searchcount
- Number of latest tweets matching the criteria to retrieve. Defaults to 30, maximum is 100.language
- If specified, only return tweets in the provided language. For example:en
,de
,jp
, etc.
You can also use dynamic values from the datastore. See the docs for more info.
To obtain API credentials, you need to first register your application on the Twitter Application Management page.
After you have done that, go to the Keys and Access Tokens
tab where you can
find your consumer key and secret. On the same page you can also generate an
access token (click on the Create my access token
button).
For the sensor a "Read only" token is sufficient, but for the action you need to use a token with a "Read and Write" access.
This sensor searches Twitter for recent tweets matching the criteria defined in the config. When a matching Tweet is found, a trigger is dispatched.
update_status
- Action which updates your status / posts a new tweet.direct_message
- Action to direct message a user.follow
- Action to follow a user.
Rule which shows how to relay every matched tweet to the Slack channel.