Automatically tweet your latest articles and shortened URLs from Drupal

| | 2 min read

If you use drupal as a blogging platform you would want to auto tweet your new posts on to twitter. Twitter and Shorten module provides you with the basic framework required to do this and all you will need to get it working is to configure these modules. There is also a small patch that has to be applied to the twitter module (until the patch goes into the CVS) to allow the use of shortened URLs in the tweet.

The steps are as follows.

1) Download and enable the following modules.
- Twitter
- Twitter Actions
- Trigger
- Shorten

2) Download and apply the patch from http://drupal.org/node/678244#comment-2447004

3) Go to Admin » Site Configuration » Actions » Manage Actions
From the 'Make a new advanced action available' drop down pick

Post a Message to Twitter

In the new page that comes up enter twitter Username & Password. For the twitter message use something like "New Article: %title - %tinyurl"

4) Go to Sitebuilding » Triggers » Content

Under "Trigger: After saving a new post" select "Post a message to Twitter"

5) Show a little love for Drupal. Under Admin » Site Configuration » Twitter Setup, enable "Set source to Drupal when updating Twitter status"

If you see that the shortened URLs point to node/nid instead of the url alias you will have to go to your database and increase the weight of the Trigger module to above Pathauto and Twitter Actions

You are done. Go to twitter and bask in the glory of your drupal expertise ;)