The Author
  • David Sabine
August 27, 2012
Technique
Code
Awesome Andy Improves Twitter Module
Here at Myplanet, we love open source. And Twitter!

Drupal's Twitter module is actively used on more than 21,000 Drupal sites.  It's the easiest way to get Drupal to cross-post messages to Twitter.  The module is highly configurable and site administrators can not only select which content types shall post to Twitter but can pre-define the Tweets (per content type, mind you!) using tokens such as title and tinyurl.

 
The only limitation we have encountered with the Twitter module is simply that Tweets are posted either when a node is created or updated (or both).  Many of our enterprise clients, however, have implemented approval workflows between content authors, editors, and publishers -- that is, some people write material for the site but others revise and edit the material prior to publication.  The Twitter module does not, by design, handle this circumstance.
 
Andy Zhu, a (near-genius) developer in our Strategy & Support Group, decided to resolve this limitation and has shared an elegant solution with other members of the Drupal community.  His contribution is a snippet of code which can be used to extend the functionality of the Twitter module.  This page describes how to implement the code in your own site.
Thoughts?
More Like This