Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bootstrap 5.5.4 — Minor update available for module views_bootstrap (5.5.4). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: Opensolr Search 5.1.3 — Minor update available for module opensolr_search (5.1.3). Release: ServiceM8 Webform Integration 1.2.1 — Minor update available for module servicem8_webform (1.2.1). Release: PostfixAdmin 1.0.0 — Initial release available for module postfix_admin (1.0.0)! Release: ip_analyser 1.0.3 — Minor update available for module ip_analyser (1.0.3). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

The Twitter API is no longer free to use. This module will continue to exist but it won't display anything unless you subscribe to at least the Basic plan (currently $100.00/month 😱)

This module provides blocks to display/embed tweets in Drupal.

It uses the Twitter API v2 with a custom service performing request from Drupal. When displaying embed tweets, the JavaScript library is automagically loaded from Twitter.

So to say, this module have no external dependencies except to the key module which is required to securely save your Twitter application's credentials.

If the Token module exists and is enabled, you can use tokens in your search query.

Configuration

Create a project with an application on Twitter and copy/paste credentials into a new key in Drupal (e.g. Admin > Config > System > Keys):

Usage

Create a Twitter block as follow:

  • Go to Admin > Block layout
  • Place a new Twitter search block somewhere
  • Configure the search (e.g. see examples below)
  • Save the block and enjoy your tweets!

Tweets and embed tweets are rendered with two editable templates:

  • tweets.html.twig
  • tweet.html.twig

Examples

This module uses the powerful query parameter provided by Twitter API v2 giving us an infinite number of possibilities... but here are a few common use cases:

Display tweets matching word(s)

apple
apple chocolate
apple OR iphone ipad
manzana lang:es has:media -is:retweet

Display tweets for a specific #hashtag

#drupal
#drupal has:media
#drupal has:links -is:retweet

Display tweets in the current language

#drupal lang:fr
#drupal lang:[language:langcode]

Display tweets from a given user

from:drupal
from:[your-token-with-the-twitter-user-name]

Requirements

Twitter API Block Entity Reference depends on:

  • Block (core)
  • Key (contrib)

Complementary modules

Slack channel

Join me in Slack in the #twitter-api-block channel! Details on how to connect to Drupal Slack here

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Feb 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core Release date
4.0.5 Stable Mar 9, 2023
4.0.4 Stable Feb 17, 2023