Plugin: Twitter V2 API gatherer

Other versions of this plugin may exist. Please ensure you are viewing the documentation for the version that you are currently using. If you are not running the latest version of your plugin we recommend upgrading. See: list of all available versions of this plugin.
This plugin requires a paid Twitter API account. Funnelback also includes a Twitter data source that uses the (legacy) V1.1 API. See: Twitter data source for more information about gathering content from Twitter.

Purpose

This plugin is used to index content from the Twitter V2 API.

The plugin will output JSON file that should be handled further with the built-in JSONToXML filter.

By default, the most recent ten Tweets are returned per request. Using pagination, the most recent 3,200 Tweets can be retrieved.

Usage

Create a custom data source

This plugin must be used in conjunction with a custom data source. Before using this plugin ensure you have created a custom data source, then enable the plugin on this data source.

Enable the plugin

Enable the twitter-v2-api-gatherer plugin on your custom data source from the plugins screen in the search dashboard or add the following data source configuration to enable the plugin.

plugin.twitter-v2-api-gatherer.enabled=true
plugin.twitter-v2-api-gatherer.version=1.0.0
This plugin requires a full update of the data source to take effect.

Plugin configuration settings

  • plugin.twitter-v2-api-gatherer.encrypted.bearerToken (Required): The user access token for access to the Twitter API. See: https://developer.twitter.com/en/docs/authentication/oauth-2-0/bearer-tokens for more information

  • plugin.twitter-v2-api-gatherer.encrypted.userName The one in your profile after @ symbol. It will be used to retrieve userId.

  • plugin.twitter-v2-api-gatherer.encrypted.userId Twitter userId (if known)

You need to provide either a userName or userId (or you can both).

Notes:

If you want to have Tweet URLs created with userName: https://twitter.com/<userName>/status/<tweetId>, you need to provide it as a config key (see above).

If you don’t provide a userName the URLs will be created with userId: https://twitter.com/<userId>/status/<tweetId>

By default, plugin will request only tweetId and tweetText fields form API.

    {
      "edit_history_tweet_ids": [
        "123456123456"
      ],
      "id": "123456123456",
      "text": "Congratulations to Professor John Doe on receiving...."
    },

Example

The syntax to request additional fields is:

plugin.twitter-v2-api-gatherer.queryParameters.<option_name>=<option_value>

To get the created_at field from tweet.fields add this line to your config:

plugin.twitter-v2-api-gatherer.queryParameters.tweet.fields=created_at

For created_at and author_id field from tweet.fields :

plugin.twitter-v2-api-gatherer.queryParameters.tweet.fields=created_at,author_id

If you only need tweets after specific date:

plugin.twitter-v2-api-gatherer.queryParameters.start_time=2023-04-01T13:03:36.000Z

All versions of twitter-v2-api-gatherer