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 (23)
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 by Hans
|
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 by Hans
|
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 by Michael
|
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 by Nicolas
|
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 by Richard
|
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 by Richard
|
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