Package Documentation
Storm Package: synapse-twitter
The following Commands are available from this package. This documentation is generated for version 1.8.2 of the package.
Storm Commands
This package implements the following Storm Commands.
twitter.feed.adduser
Add a user to the list of Twitter accounts being monitored.
As input takes an inet:web:acct or a username specified with --user.
Once an account is added, the twitter.feed.pull command can be used to retrieve
any new tweets since the last pull.
By default, will pull as many tweets as possible during the initial pull. This can
be adjusted by specifying --start-from when adding an account to set a different
starting position.
Note: The Twitter API limits the history available to the most recent 3200
tweets. Setting the starting point back further will not bypass this restriction.
Examples:
// Add the account 'fakeuser'
twitter.feed.adduser --user fakeuser
// Add the account 'fakeuser' and 13820182 as the tweet to start from
inet:web:acct=(twitter.com, fakeuser) | twitter.feed.adduser --start-from 13820182
Usage: twitter.feed.adduser [options]
Options:
--help : Display the command usage.
--debug : Show verbose debug output.
--start-from <start_from> : The tweet id to start ingesting from. (default: 1)
--user <user> : Twitter handle to add to the accounts being monitored
twitter.feed.deluser
Remove a web account from the list of accounts being monitored
Examples:
inet:webaccount | twitter.feed.deluser
Usage: twitter.feed.deluser [options]
Options:
--help : Display the command usage.
--user <user> : Twitter handle to delete from the accounts being monitored
--debug : Show verbose debug output.
twitter.feed.list
List the accounts being monitored.
Examples:
twitter.feed.list
Usage: twitter.feed.list [options]
Options:
--help : Display the command usage.
twitter.feed.pull
Pull new tweets from the Twitter accounts being monitored.
As input can take an inet:web:acct, a username specified with --user, or --all
to update all feeds currently configured.
Before pulling the feed for a user, configure them using twitter.feed.adduser.
Examples:
// Pull new tweets for "fakeuser"
twitter.feed.pull --user fakeuser
// Pull new tweets for "fakeuser"
inet:web:acct=(twitter.com, fakeuser) | twitter.feed.pull
// Pull new tweets for all configured accounts
twitter.feed.pull --all
Usage: twitter.feed.pull [options]
Options:
--help : Display the command usage.
--user <user> : Twitter handle to pull tweets for and update offset tracking
--all : Pull tweets for all accounts added to the list of feed accounts
--auto-enroll : Automatically add any inet:web:acct not already being watched into the feed list.
--skip-scrape : Do not automatically scrape ingested tweet text for possible nodes.
--debug : Show verbose debug output.
--size <size> : Limit the number of results ingested to the given size (per-node).
--yield : Yield the newly created nodes.
twitter.limits
Print out the current rate-limit status.
Examples:
twitter.limits
Usage: twitter.limits [options]
Options:
--help : Display the command usage.
twitter.search.tweets
Search for tweets using the v2 Twitter tweets/search/recent endpoint.
As input it takes a query string and creates inet:web:post nodes from the search
results.
Note: The Twitter API limits the tweets available to the most recent week of tweets,
and that queries must be less than 512 characters long. For more information on
Twitter's search query syntax, see their documentation at
https://developer.twitter.com/en/docs/twitter-api/tweets/search/integrate/build-a-query
// find the tweets related to the search "foobar"
twitter.search.tweets "foobar"
Usage: twitter.search.tweets [options] <query>
Options:
--help : Display the command usage.
--skip-scrape : Do not automatically scrape ingested tweet text for possible nodes.
--debug : Show verbose debug output.
--yield : Yield the newly created nodes.
--size <size> : Limit the number of results ingested to the given size (per-node).
Arguments:
<query> : The search query to run against the Twitter API to search for tweets
twitter.search.users
Query the Twitter v1.1 API to search for users.
// find all the users that are relate to the query invisi
twitter.search.users "invisi"
Usage: twitter.search.users [options] <query>
Options:
--help : Display the command usage.
--debug : Show verbose debug output.
--size <size> : Limit the number of results ingested to the given size (per-node).
--yield : Yield the newly created nodes.
Arguments:
<query> : The search query to run against the Twitter API to search for users
twitter.setup.apikey
Set the Twitter API key. The value given should be the Bearer Token for interacting with the v2 API.
Usage: twitter.setup.apikey [options] <apikey>
Options:
--help : Display the command usage.
--self : Set the key as a user variable. If not used, the key is set globally.
Arguments:
<apikey> : The Twitter v2 API Bearer Token string.
twitter.setup.oauth
Set the Twitter OAuth keys to use for interacting with the v1.1 API.
Because the v2 API for Twitter is still in early access, certain portions of the
v1.1 API have not been ported over to the v2 API yet, such as the search functionality.
Use this command to set the oauth keys needed for the commands that interact with
the v1.1 API.
Currently only affects the twitter.search.users command.
Usage: twitter.setup.oauth [options] <consumerKey> <consumerSecret> <accessToken> <accessSecret>
Options:
--help : Display the command usage.
--self : Set the keys as user variables. If not used, the key is set globally.
Arguments:
<consumerKey> : The Twitter API OAuthv1 consumer key.
<consumerSecret> : The Twitter API OAuthv1 consumer secret.
<accessToken> : The Twitter API OAuthv1 access token.
<accessSecret> : The Twitter API OAuthv1 access secret.
twitter.tweets.byid
Pull down a specific tweet by tweet ID.
Examples:
// Get the tweet with id 1456591769185959938
twitter.tweets.byid 1456591769185959938
Usage: twitter.tweets.byid [options] <id>
Options:
--help : Display the command usage.
--debug : Show verbose debug output.
--yield : Yield the newly created nodes.
--skip-scrape : Do not automatically scrape ingested tweet text for possible nodes.
Arguments:
<id> : The ID of the tweet to fetch
twitter.user.followers
Get the accounts that are following a particular Twitter account.
Examples:
// Pull followers for "fakeuser"
twitter.user.followers --user fakeuser
// Pull followers for "fakeuser" and yield out the created nodes
inet:web:acct=(twitter.com, fakeuser) | twitter.user.followers --yield
Usage: twitter.user.followers [options]
Options:
--help : Display the command usage.
--user <user> : Twitter handle to query for followers.
--debug : Show verbose debug output.
--size <size> : Limit the number of results ingested to the given size (per-node).
--yield : Yield the newly created nodes.
twitter.user.following
Get the accounts that a Twitter account is following
Examples:
// Get the accounts "fakeuser" is following
twitter.user.following --user fakeuser
// Pull the list of accounts "fakeuser" is following and yield out the created nodes
inet:web:acct=(twitter.com, fakeuser) | twitter.user.following --yield
Usage: twitter.user.following [options]
Options:
--help : Display the command usage.
--user <user> : Twitter handle to query for who the account follows.
--debug : Show verbose debug output.
--size <size> : Limit the number of results ingested to the given size (per-node).
--yield : Yield the newly created nodes.
twitter.user.profile
Get profile information about a twitter user.
This will make new inet:web:acct nodes, or enrich existing ones
Examples:
// Get the profile information for the user 'fakeuser' and make a node for the account
twitter.user.profile --user fakeuser
// Lift the existing 'fakeuser' inet:web:account node and
inet:web:acct=(twitter.com, fakeuser) | twitter.user.profile
Usage: twitter.user.profile [options]
Options:
--help : Display the command usage.
--user <user> : Twitter handle to retrieve the profile details for.
--debug : Show verbose debug output.
twitter.user.tweets
Pull down the latest tweets for a user.
Note: The Twitter API limits the history available to the most recent 3200
tweets.
Examples:
// Get the last 50 tweets for the "fakeuser" account
twitter.user.tweets --user fakeuser --size 50
// Get the last 50 tweets for the "fakeuser" account
inet:web:acct=(twitter.com, fakeuser) | twitter.user.tweets --yield --size 50
// Get the last 50 tweets for the "fakeuser" account, bypassing scraping the tweets for any other
// possible indicators
inet:web:acct=(twitter.com, fakeuser) | twitter.user.tweets --yield --size 50 --skip-scrape
Usage: twitter.user.tweets [options]
Options:
--help : Display the command usage.
--user <user> : Twitter handle to retrieve tweets for.
--debug : Show verbose debug output.
--size <size> : Limit the number of results ingested to the given size (per-node).
--yield : Yield the newly created nodes.
--skip-scrape : Do not automatically scrape ingested tweet text for possible nodes.
Storm Modules
This package does not export any Storm APIs.