Twitter Commenters is a plugin for Movable Type that enables commenters to sign-in and comment on your blog using their Twitter account. Versions 2+ includes support for Twitter's OAuth authorization system and enables commenters to automatically share their comments to their Twitter stream.
Note: Version 2.1 fixes a serious bug when using OAuth, users would get a Comment Submission Error, saying that Name and Email are required. All sites running v2.0 should upgrade to v2.1 using the download link below. Simply upload the new files, no need to adjust settings or templates
Basic Auth (default):

OAuth:


Twitter comment authentication works like other auth methods in MT -- once you have installed the plugin you can enable Twitter as one of the auth options, as shown in the image above.
How It Works - Basic Auth
When the user enters their Twitter username and password in the form (shown above), the plugin submits those to the Twitter API to verfiy the credentials. If verified, the user can then post comments using their Twitter account. Their Twitter 'display name' will be shown beside their comments, and their Twitter avatar (profile photo) will be imported and shown beside their comments (if userpics are enabled in your templates).
Note that users' Twitter passwords are not stored in the MT database. An upcoming version of this plugin will enable Twitter's new OAuth support, in which case passwords would never be sent to MT at all. That version will like have an option for commenters to cc. their comments to their Twitter account. Stay tuned.
How It Works - OAuth
New in Version 2.0, you can optionally enable Twitter's new OAuth authorization system. With OAuth, user never have to submit their password info to your server. Instead, they click a "sign in with Twitter" button and they are taken to a page on Twitter.com asking them to authorize the application (see image above). One they click "Allow" they are returned to your site and they then post comments using their Twitter account. As with basic auth, their Twitter 'display name ' will be used as well as their Twitter avatar (profile photo).
Share Comments on Twitter
A new feature in version 2.0, only supported via OAuth, enables commenters to optionally share their comment to their Twitter stream. All they have to do is click a checkbox, no need to re-authorize or enter Twitter account info.
Try it Now
MT Hacks has the new OAuth method enabled. Try it now:
Click here to login with your Twitter account. After logging in, you will be returned to this entry, and you can leave a comment below.
Requirements
- Net::Twitter 2.07 perl module (included with plugin) (note: do not upgrade to version 2.9+ of this module)
- Net::Twitter::OAuth perl module (included with plugin)
- Net::OAuth perl module (included with plugin)
- Net::OAuth::Simple perl module (included with plugin)
- JSON::Any perl (included with plugin)
Note: Net::Twitter requires newer versions of the libwww-perl collection of Perl modules. I am not sure what the minimum version required is, but on my server, I had to upgrade in order to get Net::Twitter to work. So if you get strange errors, try installing the latest version in your 'extlib' directory of your MT. Update: A common error message is: "Can't locate object method "default_header" via package "LWP::UserAgent" -- if you see this error, this the problem.
Download Twitter Commenters
Installation
- Upload the contents of the 'plugins' folder to the 'plugins' directory for your MT install.
- Upload the contents of the 'mt-static' folder to your 'mt-static' directory.
- For each blog you want to enable, go to Preferences > Registration and check the box for 'Twitter'.
Enabling Twitter OAuth
Unfortunately, this is not as easy as it could be, maybe Twitter will make it easier in future. To set this up you need to create an Application on Twitter:
- While logged in to your Twitter account, go to http://twitter.com/oauth_clients/new.
- Fill out the form on that page:
- Give it a unique name and description.
- For 'Application Website', enter http://mt-hacks.com/twittercommenters.html. For 'Organization', enter MT Hacks.
- For 'Website' enter http://mt-hacks.com.
- For 'Application Type' choose 'Browser'.
- For 'Callback URL' enter the full URL to your comments script followed by '?__mode=login_external&key=Twitter'. Example: http://www.domain.com/cgi-bin/mt/mt-comments.cgi?__mode=login_external&key=Twitter
- For 'Default Access type' choose 'Read & Write'.
- Check the box for 'Yes, use Twitter for login'
- Hit the 'Save' button.
- After saving the application, you should now see a screen with a 'Consumer key' and 'Consumer secret'. Copy those to the system plugin Settings (System Overview > Plugins > Twitter Commenters > Settings). and save the plugin settings.
- To enable the share comment on Twitter option, add the <mt:TwitterShareCommentOption> tag below the comment text part of your comment form. This will display a checkbox option to people logged in via Twitter OAuth.
- Rebuild your entry pages and test it out
As always, feedback is appreciated.
Follow @mthacks on Twitter for updates and other MT and Twitter hacks.


Comments (47)
if you get a "JSON::Any version 1.19 required--this is only version 1.18" error, here is the likely fix:
This is probably happening because you have the Facebooker Commenters plugin installed, which includes JSON::Any 1.18 in its /extlib/ and this is conflicting with v1.19 that is included with Twitter Commenters.
To fix, go to:
/path/to/mt/plugins/FacebookCommenters/extlib/JSON/
and delete Any.pm
This won't break anything, as version 1.19 will be found by MT in the Twitter Commenters plugin.
Posted by Mark Carey
|
July 14, 2009 10:35 AM
Posted on July 14, 2009 10:35
For those getting the "Can't locate object method default_header" error, stepS to fix:
Posted by Mark Carey
|
July 19, 2009 8:49 PM
Posted on July 19, 2009 20:49
This won't break anything, as version 1.19 will be found by MT in the Twitter Commenters plugin http://www.chat.t7b.com/123.htm
Posted by دردشه | July 22, 2009 10:35 AM
Posted on July 22, 2009 10:35
Hi Mark, thanks for continuing to put out cool and useful MT plugins.
I've installed Twitter Commenters 2.1 on my MT 4.25 installation, deleted Any.pm from my Facebook Commenters plugin, and updated my version of libwww-perl. I'm getting the error "Can't call method "permalink" on an undefined value" when trying either the Basic or OAuth methods. Got another simple fix up your sleeves?
Posted by Dave Wells | July 24, 2009 5:24 PM
Posted on July 24, 2009 17:24
Hi again - I should add two bits of information. The error occurs when clicking "Sign In" (in basic mode) or the "Sign In With Twitter" button (in OAuth mode). When in basic mode, it seems that logins do succeed, despite the message. MT doesn't recognize that I'm signed in initially, but if I click mt login link again, it then tells me I'm already signed in.
Posted by Dave Wells | July 24, 2009 5:33 PM
Posted on July 24, 2009 17:33
Thx for the plugin, but I cannot rebuild my postings in MT 4.26
Posted byHans
|
July 27, 2009 8:08 AM
Posted on July 27, 2009 08:08
Actually I cannot rebuild anything anymore bleh. I saw the twitterplugin updated the database..... How can I correct this or go back? Please urgently reply on this.
Posted byHans
|
July 27, 2009 9:13 AM
Posted on July 27, 2009 09:13
thanks
Posted by منتديات | July 31, 2009 2:36 AM
Posted on July 31, 2009 02:36
Hi Mark,
I'm still getting this error even after installing the /lib/.
An error occurred. Can't locate object method "default_header" via package "LWP::UserAgent"
Thanks.
-Mike
Posted byMichael
|
August 1, 2009 7:45 AM
Posted on August 1, 2009 07:45
Thanks for your contenous effort!!
I have successfully done all the requirements and rebuilts. Once I try to login using twitter, this is the rror I get
"Can't locate object method "default_header" via package "LWP::UserAgent""
ANy help?
TIA!
Posted by Faramarz | September 16, 2009 1:46 PM
Posted on September 16, 2009 13:46
I'm getting the same error, despite setting up a Twitter app. Should I just abandon the use of this plugin?
Posted by Jesse Gardner | September 18, 2009 10:38 AM
Posted on September 18, 2009 10:38
Sorry I missed your update in the comments... might want to add it to the main post if it's a common problem. However, I downloaded the libwww and installed it, but now i'm getting the error: Unable to load HMAC_SHA1 plugin. Any ideas?
Posted by Jesse Gardner | September 18, 2009 10:46 AM
Posted on September 18, 2009 10:46
Jesse, it is indeed mentioned in the main post -- the catch is, you have to read the main post to get! ;) On a serious note, perhaps I should put it in big blod letters or highlight it better, as several people have missed it...
Regarding the HMAC_SHA1 error, is that the exact perl package referenced? What does the error message say exactly? Seems like this may be a perl module that is installed on many servers by default (based on the fact that you are the first to report this, anyway) and not on others. Installing that perl module should fix it...
Posted by Mark Carey
|
September 18, 2009 11:45 AM
Posted on September 18, 2009 11:45
Hi Mark,
I just tried installing TwitterCommenters on my blog (following the directions and reading all the comments carefully) and I've ended up with the same problem as @Dave Wells has.
That is to say, login with Twitter fails with:
"Can't call method "permalink" on an undefined value"
Any clues or ideas? I noticed that @Dave's site doesn't currently let you login with Twitter either. Should I just turn it off for now?
Cheers
Posted by Craig Phillips
|
September 25, 2009 12:37 AM
Posted on September 25, 2009 00:37
I get the same error as @Craig Phillips above. I'm using MT-4.32-fr (pro).
I already fixed the JSON error caused by Facebook Commenters and the LWP error caused by old version of libwww-perl.
Posted byNicolas
|
October 17, 2009 12:46 PM
Posted on October 17, 2009 12:46
I am getting the same error as Jesse: "Unable to load HMAC_SHA1 plugin." I have installed all stated Perl modules - but still, no dice.
Posted by Byrne Reese | October 20, 2009 2:52 PM
Posted on October 20, 2009 14:52
I am also getting the same error as Craig and Nicolas. Have you guys gotten it working on your sites yet? If so what was the fix?
Posted by Anonymous | November 13, 2009 11:28 PM
Posted on November 13, 2009 23:28
That was weird. Not sure why it posted that last one as anonymous but it was me with the 'permalink' error.
Posted byRichard
|
November 13, 2009 11:29 PM
Posted on November 13, 2009 23:29
After a bit of research I see that Twitter Commenters doesn't work in MT Pro (http://bgviewsnetwork.com/dev/2009/07/twitter-commenters-21-doesnt-work-in-mt-pro/) Have you had the opportunity to look into it yet? I don't know about other folks but it would certainly be something I would be willing to pay for.
Posted byRichard
|
November 14, 2009 5:39 PM
Posted on November 14, 2009 17:39
thanks
Posted by tuba buyukustun | November 23, 2009 5:15 PM
Posted on November 23, 2009 17:15
thanks
Posted by دردشه صوتيه | December 12, 2009 8:08 AM
Posted on December 12, 2009 08:08
Awesome idea, I love it!
Posted by Bekzod Ruzmetov
|
January 15, 2010 4:09 PM
Posted on January 15, 2010 16:09
thank
Posted by voicechat | January 28, 2010 6:56 AM
Posted on January 28, 2010 06:56
I'm getting the same error, despite setting up a Twitter app. Should I just abandon the use of this plugin? شات صوتي
Posted by شات صوتي | February 11, 2010 6:40 PM
Posted on February 11, 2010 18:40
The problem with "Can't call method "permalink" on an undefined value" is caused by the latest MT javascript templates not including the entry-id in the url which the twitter plugin seems to need.
To fix replace your mtSignIn with this:
function mtSignIn() {
var doc_url = document.URL;
doc_url = doc_url.replace(/#.+/, '');
var url = '<$mt:SignInLink$>';
if (is_preview) {
if ( document['comments_form'] ) {
var entry_id = document['comments_form'].entry_id.value;
url += '&entry_id=' + entry_id;
} else {
url += '&return_url=<$mt:BlogURL encode_url="1"$>#commentform';
}
} else {
if ( document['comments_form'] ) {
var entry_id = document['comments_form'].entry_id.value;
url += '&entry_id=' + entry_id;
}
url += '&return_url=' + encodeURIComponent(doc_url + '#commentform');
}
mtClearUser();
location.href = url;
}
Can someone who knows more about the arcane art of MT JavaScript tell me if there is anything really stupid about what I've done there?
Posted byRichard
|
February 17, 2010 11:06 AM
Posted on February 17, 2010 11:06
i'm logged in and rarin' to go
Posted by marctest
|
February 23, 2010 1:11 PM
Posted on February 23, 2010 13:11
JavaScript tell me if there is anything really stupid
Posted by عالمك | April 2, 2010 10:36 PM
Posted on April 2, 2010 22:36
My version is 5.01. i got Richard's mtSignIn script. That's good. but the script make to disenable other Authentication(google, yahoo, openID)... :( help me.
Posted by minordev
|
April 11, 2010 6:54 AM
Posted on April 11, 2010 06:54
Great
Posted by Anonymous | May 22, 2010 1:16 PM
Posted on May 22, 2010 13:16
thankyou
Posted by ヘイゼル
|
May 26, 2010 12:22 PM
Posted on May 26, 2010 12:22
minordev me too...
Posted by ヘイゼル
|
May 27, 2010 10:21 AM
Posted on May 27, 2010 10:21
Richard's solution worked for me on a MT5 installation...
Posted by Maarten Schenk | June 29, 2010 9:18 AM
Posted on June 29, 2010 09:18
When I connect with this plugin, I get all the way to Twitter redirecting me back to my site then I get the following error:
Can't use string ("request tokens dont match") as a HASH ref while "strict refs" in use
Any idea as to what's causing this?
Posted by Scott Yoshinaga | July 5, 2010 12:14 AM
Posted on July 5, 2010 00:14
Okay I fixed my own problem. Turns out I foolishly just overwrote everything by copying over libwww-perl. Once I started with a fresh extlib and added libwww-perl items in one by one and also added HMAC SHA pm everything worked fine.
Posted by Scott Yoshinaga | July 6, 2010 12:42 AM
Posted on July 6, 2010 00:42
Just testing - this should drag in my twitter profile
Posted by anu
|
July 29, 2010 10:07 AM
Posted on July 29, 2010 10:07
I also had problems with HMAC_SHA1. The cure came in installing the Net::Oauth perl package. Now when I did this on debian using libnet-oauth-perl deb package it also installed libdigest-hmac-perl so it might actually be Digest::HMAC which was missing but I can't be bothered to find out I'm afraid.
Posted by Andrew Bowden | September 13, 2010 12:18 PM
Posted on September 13, 2010 12:18
The "Post comment to twitter" feature isn't working for me. Does it work even if comment moderation is enabled? Is there anything else I can check to see why this might not work? A debug log?
Posted by Quinn Comendant
|
September 28, 2010 10:11 PM
Posted on September 28, 2010 22:11
this is the way it should be on every blog -- comments tweet out
Posted by alexanderrusso
|
October 16, 2010 5:56 PM
Posted on October 16, 2010 17:56
only thing is, the comments don't / aren't showing up on twitter even though i check the box
Posted by alexanderrusso
|
October 16, 2010 6:01 PM
Posted on October 16, 2010 18:01
Some really great photos here. I'd never even heard of 8-bit music before so thanks for enlightening me! Jim.
will be fresh in my ears as long as i live.
Posted by شات وناسه دردشة وناسه | October 23, 2010 2:52 AM
Posted on October 23, 2010 02:52
Some really great photos here. I'd never even heard of 8-bit music before so thanks for enlightening me! Jim.
will be fresh in my ears as long as i live.
Posted by ilahi dinle | November 13, 2010 2:19 PM
Posted on November 13, 2010 14:19
i'm logged in and rarin' to go..
Posted by tuz | November 29, 2010 3:43 AM
Posted on November 29, 2010 03:43
Now when I did this on debian using libnet-oauth-perl deb package it also installed libdigest-hmac-perl so it might actually be Digest::HMAC which was missing but I can't be bothered to find out I'm afraid?
Posted by oltu tasi tesbih | January 27, 2011 9:02 AM
Posted on January 27, 2011 09:02
Okay I fixed my own problem. Turns out I foolishly just overwrote everything by copying over libwww-perl. Once I started with a fresh extlib and added libwww-perl items in one by one and also added HMAC SHA pm everything worked fine...
Posted by tesbih | March 1, 2011 6:46 PM
Posted on March 1, 2011 18:46
thankx you
Posted by كويت الحب | April 19, 2011 7:58 AM
Posted on April 19, 2011 07:58
ed watching the video
Posted by كويت الحب | April 19, 2011 8:01 AM
Posted on April 19, 2011 08:01
this is the way it should be on every blog -- comments tweet out
Posted by بنت مصر | June 5, 2011 6:09 PM
Posted on June 5, 2011 18:09