xima/xima-twitter-client

There is no license information available for the latest version (3.0.0) of this package.

Import and display tweets

Maintainers

Package info

github.com/xima-media/xima-typo3-twitter-client

Type:typo3-cms-extension

pkg:composer/xima/xima-twitter-client

Statistics

Installs: 3 628

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 2

3.0.0 2026-03-30 06:45 UTC

README

Extension icon

TYPO3 extension xima_twitter_client

Supported TYPO3 versions Composer

This extension uses the Twitter/X API v2 to import and display tweets. It provides a scheduler command for automated imports and a content element for frontend display.

Backend Wizard preview

Requirements

To use the Twitter API, you need a developer account at developer.twitter.com. Register your application and obtain:

  • API Key (Consumer Key)
  • API Secret (Consumer Secret)
  • Access Token
  • Access Token Secret

The database must be configured to use the utf8mb4 charset and collation. The standard MySQL utf8 charset does not support 4-byte characters such as emojis, which are common in tweets. Without utf8mb4, saving tweets containing emojis will produce an SQL error.

Install

Composer

composer require xima/xima-twitter-client

TER

TER version

Download the zip file from TYPO3 extension repository (TER).

Setup

1. Add Site Set

Add the extension's site set to your site configuration (config/sites/<your-site>/config.yaml):

sets:
    - xima/xima-twitter-client

This automatically includes the TypoScript and PageTSconfig.

2. Configure API Credentials

Add the credentials to your extension configuration (e.g., in additional.php):

$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['xima_twitter_client'] = [
    'api_key' => 'your-api-key',
    'api_secret' => 'your-api-secret',
    'access_key' => 'your-access-token',
    'access_secret' => 'your-access-token-secret',
    'image_storage' => '1:Images/Twitter',
];

3. Create Account Records

  1. Create a new SysFolder and enable the "Twitter" module
  2. Add a new Account record inside this folder
  3. Enter the Twitter username you want to fetch tweets from
  4. Configure the maximum number of tweets to fetch

Backend account form

Usage

Import Command

Fetch tweets from all configured accounts:

vendor/bin/typo3 twitter:fetchTweets

Command Options

Option Description
--account, -a Fetch tweets for a specific account UID only
--dry-run Validate configuration without fetching tweets
-v Verbose output with detailed error messages

Examples

# Fetch tweets for all accounts
vendor/bin/typo3 twitter:fetchTweets

# Fetch tweets for a specific account
vendor/bin/typo3 twitter:fetchTweets --account=5

# Validate configuration only
vendor/bin/typo3 twitter:fetchTweets --dry-run

# Verbose output for debugging
vendor/bin/typo3 twitter:fetchTweets -v

Cleanup Command

Remove tweets (and their associated images) older than a given number of days:

vendor/bin/typo3 twitter:cleanupTweets

Command Options

Option Description
--lifetime, -l Maximum age of tweets in days (default: 180)
--dry-run Preview what would be deleted without actually deleting

Examples

# Remove tweets older than 180 days (default)
vendor/bin/typo3 twitter:cleanupTweets

# Remove tweets older than 90 days
vendor/bin/typo3 twitter:cleanupTweets --lifetime=90

# Preview what would be deleted
vendor/bin/typo3 twitter:cleanupTweets --dry-run

Scheduler Task

You can set up both the import and cleanup commands as scheduler tasks for automated execution.

Content Element

Add the Twitter content element to any page to display the imported tweets:

Frontend feed

Configuration

Site Settings

Override the default settings in your site configuration (config/sites/<your-site>/settings.yaml):

plugin:
    tx_ximatwitterclient:
        settings:
            maxItems: 10

Extension Configuration

Key Description Example
api_key Twitter API Key
api_secret Twitter API Secret
access_key Twitter Access Token
access_secret Twitter Access Token Secret
image_storage FAL storage path for downloaded images 1:Images/Twitter

Troubleshooting

API Authentication Errors

Ensure all four API credentials are correctly configured. Use the --dry-run option to validate your configuration:

vendor/bin/typo3 twitter:fetchTweets --dry-run

Image Storage Errors

Make sure the configured image_storage path exists and is writable. The path should be a valid FAL combined identifier (e.g., 1:Images/Twitter).

Rate Limiting

The Twitter API has rate limits. If you encounter rate limit errors, reduce the import frequency or the number of tweets fetched per account.

License

This project is licensed under GNU General Public License 2.0 (or later).

Contribute

This extension was made by Maik Schneider. Feel free to contribute!

Thanks to XIMA!