New Drupal module: Selective Tweets

Published by Lennart Van Vaerenbergh on July 13, 2015

Being a Drupal developer, there's a big chance you've already gotten the task to implement a Twitter feed or Twitter tweet. So did I. As the currently available contrib modules didn't meet my needs, I created a new Twitter module. Yes, another one. But it differs from the rest in a couple of ways.

First of all, here's the link to the project page: Selective Tweets.

Twitter logoOnce you downloaded and enabled the module, you fill in your Twitter developer account credentials and you're good to go. You can create Twitter blocks at will and each one of them can display a different set of tweets. Be it one or multiple tweets, filtered by hashtag, user mention or Twitter timeline. It's easy to play around with and the changes take place immediately.

The main features are:
  • Create a new block for every new Twitter integration.
  • Display only one or multiple tweets.
  • Infinite load more pager (as long as there are tweet cached).
  • Custom theming of tweets or embedded tweet widgets.
  • Filter tweets by hashtag, user mention, to-user and from-user.
  • Show favorited tweets of a specific user.
  • No tweets are permanently stored in the database, so no overhead in the database.

There are a couple of other Twitter modules out there, and these are the main differences:
  • It stores no tweets in database. Not as nodes and not in custom tables.
  • You can apply filters to every implemented tweet feed on the fly.
  • You're able to display just one tweet.
  • The content is ajax loaded, so it doesn't hold back the load time of your website.
  • Most other features are available in the other modules, one way or another.
Screenshot of Selective Tweets with the embedded render mode turned on.
Here's a list of other used Twitter modules and the way they differ from Selective Tweets. This information can also be found on the project page.

The Twitter module is the most used Twitter integration module. It offers more functionality than only embed timelines or tweets, like Selective Tweets does. The main difference concerning the displaying of tweets, is the fact that Twitter stores the tweets in the Drupal database while Selective Tweets does not. On the other hand, storing the tweets in database gives the opportunity to display tweets in Views.
Use Selective Tweets when you want a light weight manner of displaying Tweets without database storing, with the flexibility of filtering tweets and theming them through a simple template override.

Tweet Feed
Tweet Feed does regular imports of Tweets and turns them into nodes, while Selective Tweets renders Tweets almost realtime and saves none of them in the database as content. This is also the main difference, with the effect that Tweet Feed has a significant delay on the realtime Tweets. On the other hand, the Tweet Feed created nodes can be displayed in Views which gives big flexibility in the way of displaying Tweets.
Use Selective Tweets when you want a light weight manner of displaying Tweets without database storing and you want no major delay in displaying realtime tweets.

Twitter Block
Twitter block does a nice job to embed a timeline widget into a block. Selective Tweets does not embed timelines, but instead embeds separate Tweets which are easier to manipulate. Selective Tweets can also be rendered as raw html and modified to suit your needs via template overriding.

Twitter Timeline
I haven't tried out this one myself, but it appears to be similar to Twitter Block. That is, inserting a Twitter timeline widget.

Is it yet another obsolete Twitter module? Perhaps, time will tell. It has a couple of features I couldn't find out there so that's why I published it.
Could I have integrated this functionality in existing modules? Again, perhaps I could have. But I already started making this module and I've gotten too far to change everything, it's still developed for project with a certain time scope... as these things go.

Feel free to give your opinion.

Add new comment

(If you're a human, don't change the following field)
Your first name.
(If you're a human, don't change the following field)
Your first name.
This challenge is for testing whether or not you are a human visitor and to prevent automated spam submissions.