Twitter Connect (sort of)

Note:  Learn about the latest version and see additional instructions on this post.

 

If you take a look at my comment form on this blog, you’ll notice the addition of a little blue button.  Click on the button and you can claim your comments using your Twitter credentials.  This process tells my blog who you are, but I never have to ask for a password.  I’m using a WordPress plugin called Twit Connect.  I wrote it today, based on the work done by Adam Hupp of Facebook.  Although this plugin is nowhere near as complex as the Facebook Connect code, it provides the basic login into WordPress and will display avatars with each comment.

I’ll probably release this plugin in a few days after I try it out and get more feedback.  Give it a try yourself and leave me a comment on this post.

Update:  Download The Plugin From WordPress.org

Update 2: Adding the code to your Comments.php File:

Each theme will be slightly different, but you should place the code right about the Name field.  look for code like this in your comments file:

<?php else : ?>

<?php twit_connect() ?>

<p> <strong><?php _e(‘Name:’); ?> <?php if ($req) _e(‘(Required)’); ?></strong><br/>

<input type="text" name="author" id="author" value=" <?php echo $comment_author; ?>" tabindex="1" />

 

  • Share/Bookmark

111 Comments so far »

  1. swhitley (Shannon Whitley) said,

    Wrote on March 24, 2009 @ 1:20 pm

    Twitter Comment


    Twitter Connect (sort of) – New WordPress Plugin – Claim blog comments w/ your Twitter login – [link to post]

    – Posted using Chat Catcher

  2. TwitLinksRSS (TwitLinksRSS) said,

    Wrote on March 24, 2009 @ 1:52 pm

    Twitter Comment


    Twitter Connect (sort of) | Shannon Whitley: If you take a look at my comment form on this blog, you’ll notice t.. [link to post]

    – Posted using Chat Catcher

  3. lyf108 (Larissa Fair) said,

    Wrote on March 24, 2009 @ 2:18 pm

    Twitter Comment


    RT @swhitley Holding my breath until someone tries this. Please comment on the Twit Connect WP plugin before I pass out – [link to post]

    – Posted using Chat Catcher

  4. Andrew Arnold said,

    Wrote on March 24, 2009 @ 2:28 pm

    I can sign in but the comment gets lost in cyberspace

  5. Andrew Arnold said,

    Wrote on March 24, 2009 @ 2:28 pm

    Except it doesn’t now!

  6. Jason Nassi said,

    Wrote on March 24, 2009 @ 2:36 pm

    Testing so Shannon doesn’t have to hold his breath any longer.

    Note that you have to be logged into the Twitter website first, if you don’t want to be prompted with a username/password dialog.

  7. fszf said,

    Wrote on March 24, 2009 @ 5:24 pm

    test

  8. Ike Pigott said,

    Wrote on March 24, 2009 @ 6:53 pm

    Hey… have you had any luck with that plugin.php line 456 thing?

  9. swhitley (Shannon Whitley) said,

    Wrote on March 24, 2009 @ 11:57 pm

    Twitter Comment


    Also showing Twitter avatars with Twit Connect on my blog. Should release the plugin tomorrow – [link to post]

    – Posted using Chat Catcher

  10. Dominic Jones said,

    Wrote on March 24, 2009 @ 11:59 pm

    Need to think about this more, but I love how you’re always innovating.

  11. Neville Hobson said,

    Wrote on March 25, 2009 @ 3:25 am

    Like it, Shannon. And would like to try it out on one of my blogs.

  12. clarkalastair said,

    Wrote on March 25, 2009 @ 7:04 am

    like it, I wish blogger would make something like this too. :-) keep it up

  13. cathy b said,

    Wrote on March 25, 2009 @ 7:05 am

    it worked! looking forward to getting the codeing to implement it into the blogging! thank you!

  14. cathy b said,

    Wrote on March 25, 2009 @ 7:07 am

    well interesting… i see it took my old twitter profile.. I have a photo in my new profile… hmmm.. wonder why it did that?
    also I look forward to blogger doing this as well.

  15. Nancy Beckley said,

    Wrote on March 25, 2009 @ 7:08 am

    Giving this a test run. The first time, I got a message that said I was ‘responding too quick, slow down”.

  16. Mark Bailey said,

    Wrote on March 25, 2009 @ 7:09 am

    Looking forward to this. Thank you!

  17. Andrew Chapman said,

    Wrote on March 25, 2009 @ 7:23 am

    Fantastic idea – seems slow, but that’s presumably Twitter…

  18. Andrew Chapman said,

    Wrote on March 25, 2009 @ 7:25 am

    (Wouldn’t it make more sense to link to the person’s Twitter stream rather than to their website, though?)

  19. villaves56 said,

    Wrote on March 25, 2009 @ 8:55 am

    Probando este sistema para la realización de comentarios en blogs

  20. swhitley said,

    Wrote on March 25, 2009 @ 9:30 am

    @Andrew Chapman

    Good question. I’m pulling the url from Twitter and making that the author’s url in WordPress. Maybe I’ll make it an option and let the blog owner decide.

  21. swhitley said,

    Wrote on March 25, 2009 @ 1:52 pm

    I just updated this post with a link to the plugin.

  22. Ella Hall said,

    Wrote on March 25, 2009 @ 2:28 pm

    nice one!

  23. swhitley said,

    Wrote on March 25, 2009 @ 11:11 pm

    Updated this post to point to WordPress.org for the download.

  24. swhitley (Shannon Whitley) said,

    Wrote on March 25, 2009 @ 11:16 pm

    Twitter Comment


    For late owls (I’m off to bed), Twit Connect WordPress Plugin. Claim comments w/ your Twitter id – [link to post]

    – Posted using Chat Catcher

  25. Jason Ryan said,

    Wrote on March 25, 2009 @ 11:22 pm

    Very nice work Shannon. OAuth works a treat…

  26. jasonwryan (Jason Ryan) said,

    Wrote on March 25, 2009 @ 11:28 pm

    Twitter Comment


    RT @swhitley: Twit Connect WordPress Plugin. Claim comments w/ your Twitter id – [link to post] < Very nice...

    – Posted using Chat Catcher

  27. Erlend Førsund said,

    Wrote on March 26, 2009 @ 1:15 am

    Prøver ut en ny Twitter plugin på http://tinyurl.com/crqmo7

  28. Angelo said,

    Wrote on March 26, 2009 @ 2:22 am

    Trying to see if my comment will be published as a twitt on my twitter account

  29. Keith Burnage said,

    Wrote on March 26, 2009 @ 2:34 am

    RT @swhitley: Twit Connect WordPress Plugin. Claim comments w/ your Twitter id – [http://tinyurl.com/cv2f5l] #twitter #WordPress

  30. Ryan Levesque said,

    Wrote on March 26, 2009 @ 4:19 am

    Pretty Cool!

  31. Jens said,

    Wrote on March 26, 2009 @ 7:02 am

    test

  32. DaveMora (Dave Mora) said,

    Wrote on March 26, 2009 @ 10:04 am

    Twitter Comment


    [link to post] is it just me or is twitter new OAuth and Facebook connect going to a close version of “OpenID” ?

    – Posted using Chat Catcher

  33. Gary Jones said,

    Wrote on March 27, 2009 @ 8:07 am

    Looks to be a very useful plugin – nice work :)

  34. tobyvacher said,

    Wrote on March 27, 2009 @ 4:25 pm

    Hey, Just wanted to try it out. think i might use it on my blog :D

  35. Tazzy and Piggy said,

    Wrote on March 28, 2009 @ 5:34 am

    Oh, I like this! Much neater than Facebook!

  36. { Suzanne Ahjira } said,

    Wrote on March 28, 2009 @ 1:58 pm

    Twitter Connect Adds Comment Functionality…

    I got a nice lead on another Twitter plug-in for WordPress today, Twitter Connect. I’m trying to understand the value-add here (versus the cost of running the plug-in) (and that’s “cost” as in the extra bandwidth it adds to your…

  37. festivalfan said,

    Wrote on March 31, 2009 @ 3:19 pm

    I do not know where to add the code in my wordpress theme to get the twit connect plugin to work

  38. swhitley said,

    Wrote on March 31, 2009 @ 3:31 pm

    @festivalfan – I just updated this post with additional instructions on placing the code in your comments.php file.

  39. festivalfan said,

    Wrote on March 31, 2009 @ 3:53 pm

    Wow thanks mate, I have got it working now see

    http://benicassimfestival.co.uk/benicassim-travel-top-tip/

    I agree with comments above I would love it if the url on the profile name went to their twitter address

    Thanks for your quick reply, I thought i going crazy as that help bit was not there before

    I will tweet about this plugin

  40. barneyc (Barney Craggs) said,

    Wrote on April 1, 2009 @ 7:40 am

    Twitter Comment


    Twitter Connect (sort of) | Shannon Whitley [link to post]

    – Posted using Chat Catcher

  41. Jonathan Hopkins said,

    Wrote on April 1, 2009 @ 7:42 am

    Nice work ;)

  42. tonys (Tony Scott) said,

    Wrote on April 1, 2009 @ 7:45 am

    Twitter Comment


    RT @barneyc: Twitter Connect (sort of) | Shannon Whitley [link to post]

    – Posted using Chat Catcher

  43. cidermaker (cidermaker) said,

    Wrote on April 1, 2009 @ 8:51 am

    Twitter Comment


    RT @Twitter_Tips USE TWITTER FOR Blog comments with this new plugin [link to post] –Share: http://bit.ly/SqEVh

    – Posted using Chat Catcher

  44. FlaviaPM said,

    Wrote on April 3, 2009 @ 6:05 am

    Any chance, something like this to wordpress.com?

  45. michaelmaass (michaelmaass) said,

    Wrote on April 5, 2009 @ 1:11 am

    Twitter Comment


    @sacrion check this out. definitiv cool : [link to post]

    – Posted using Chat Catcher

  46. mthing said,

    Wrote on April 5, 2009 @ 9:38 am

    this looks good. will try it, see if it plays nice w/ my disqus install.

  47. Wellington Pinho said,

    Wrote on April 5, 2009 @ 7:11 pm

    Teste…

  48. Teaser-Trailer.com said,

    Wrote on April 5, 2009 @ 9:47 pm

    hi

  49. Teaser-Trailer.com said,

    Wrote on April 6, 2009 @ 1:54 am

    Are you going to release the code of a php version of mytweeple . com/twc.aspx?

    I see in your code that you’re calling this site of yours.

    In the current version it’s a kind of security risk, would be better if you were giving full control of the script.

    Any chance you release a more complete version of twitter connect?

  50. Teaser-Trailer.com said,

    Wrote on April 6, 2009 @ 3:37 am

    What I’d need if your code with the php twitter-oauth code available at http://github.com/poseurtech/twitteroauth/tree/master

    too badc i’m not techy enough to make it myself :(

  51. David Harrington said,

    Wrote on April 8, 2009 @ 7:53 am

    This is awesome. It actually works a lot like Facebook Connector from Sociable.es. What’s the best way to put this into the sidebar as a widget instead of in the comments section? Also, I have both Facebook Connector and this installed but the Twitter avatars seem to override the Facebook or WordPress avatars. Anyone know of a way to resolve this?

  52. adrian b said,

    Wrote on April 8, 2009 @ 9:50 am

    I am trying to install you widget, however, have little experience in php. I got the twitter connect button to show up, but users can’t log out. They just get a message explaining “you are attempting to log out of my blog”, and nothing happens. Is there something i am missing?

  53. shannon said,

    Wrote on April 9, 2009 @ 6:03 am

    Sorry about lack of reply. On holiday for a few more days.

  54. myzerowaste said,

    Wrote on April 10, 2009 @ 6:09 am

    Loving this idea … cool to see it work

  55. Windows Secrets said,

    Wrote on April 10, 2009 @ 9:00 am

    Testing this plugin.

  56. swhitley said,

    Wrote on April 16, 2009 @ 10:52 pm

    @adrian b

    The problem where your users can’t logout is actually a theme issue (it happens even w/o this plugin). I had the same issue with this theme.

    The fix is to change the logout link in your comments.php file. This is the new code that I’m using in my theme. Notice how it uses the wp_logout_url function.

    <a href=”<?php echo wp_logout_url(get_permalink()) ?>” title=”<?php _e(‘Log out of this account’) ?>”><?php _e(‘Logout’); ?> »</a>

  57. Ivor said,

    Wrote on April 17, 2009 @ 10:10 pm

  58. ipad (Ivor) said,

    Wrote on April 17, 2009 @ 10:33 pm

    Twitter Comment


    @huguito @webjac es fácil de integrar Twitter Connect [link to post] #twitterconnect

    – Posted using Chat Catcher

  59. Hugo Londoño said,

    Wrote on April 17, 2009 @ 10:38 pm

    My test

  60. Pepa said,

    Wrote on April 18, 2009 @ 12:19 pm

    Viva la Pepa!

  61. swhitley said,

    Wrote on April 18, 2009 @ 7:26 pm

    I’ve released a new version of the plugin that allows you to display the author’s Twitter profile url. It will no longer override avatars from other plugins. The author’s email address will also be displayed to encourage the author to change it.

  62. faizal said,

    Wrote on April 18, 2009 @ 11:22 pm

    cool!

  63. tracysurf said,

    Wrote on April 19, 2009 @ 12:12 am

    Testing with my testing account

  64. Lafayette said,

    Wrote on April 19, 2009 @ 11:06 pm

    cool

  65. Jason Pratt said,

    Wrote on April 20, 2009 @ 8:08 am

    Testing this out. Didn’t see a confirmation that it worked…odd.

  66. Jens Sarton said,

    Wrote on April 21, 2009 @ 9:42 am

    i got a fatal error when i try to install it.

    Parse error: syntax error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /homepages/0/xxxxxxxxxxx/htdocs/schadenabteilung/wp-content/plugins/twitconnect/EpiCurl.php on line 4

    any ideas?

  67. swhitley said,

    Wrote on April 21, 2009 @ 11:53 am

    New version of the plugin allows you to setup your own oAuth app –
    http://www.voiceoftech.com/swhitley/?p=701

  68. Patrick Altoft said,

    Wrote on April 21, 2009 @ 12:34 pm

    Awesome integration

  69. Ozh RICHARD said,

    Wrote on April 21, 2009 @ 2:43 pm

    Wicked. Anyway to avoid the page reload with something updating in a iframe or something like this?

  70. Yamile Yemoonyah said,

    Wrote on April 21, 2009 @ 3:16 pm

    I get the same fatal error as Jens :-(

  71. swhitley said,

    Wrote on April 21, 2009 @ 4:20 pm

    @Jens and @Yamile – You may need PHP 5 to run the Epi code. I’ll update the plugin to make this optional.

    @Ozh – The page reload is necessary to change the logged in status. I don’t think there’s a way to get around that.

  72. JD Hartley said,

    Wrote on April 21, 2009 @ 4:25 pm

    This is AWESOME. :)

  73. oriste said,

    Wrote on April 21, 2009 @ 10:57 pm

    Hehe, I got this message from Twitter when clicking the “Sign in with Twitter” button on this page:

    “This feature is temporarily disabled.
    Thanks for your patience while we work to restore it.”

  74. swhitley said,

    Wrote on April 21, 2009 @ 11:05 pm

    @oriste — I know. Don’t you love it. For some reason Twitter has taken down oAuth. I’m not sure what’s going on but will hopefully see an announcement soon.

  75. rickdog (rick shide) said,

    Wrote on April 22, 2009 @ 1:50 am

    Twitter Comment


    tTwit> Twitter Connect (sort of) | Shannon Whitley [link to post]

    – Posted using Chat Catcher

  76. swhitley said,

    Wrote on April 22, 2009 @ 7:12 am

    I’ve posted version 1.02 which allows the plugin to run under PHP 4. PHP 4 blogs can still run the oAuth process, but the self-hosted option is not available.

  77. Sue said,

    Wrote on April 23, 2009 @ 11:47 am

    I require users to logged in to post comments by default and have implemented this plugin, but there is no prompt to log in using one’s twitter id.

  78. Shannon said,

    Wrote on April 23, 2009 @ 12:09 pm

    Twitter is sorting some things out right now with oAuth. Hopefully I’ll have some news by this afternoon. I may need to tweak the plugin depending on their changes.

    @Sue – If the user is already logged in, they won’t see the button. It works just like this blog where you see the “Sign in with Twitter” button (which won’t work until Twitter turns the service back on).

  79. swhitley said,

    Wrote on April 24, 2009 @ 1:10 am

    Just released Version 1.05 – Twitter disabled a parameter that broke Twit Connect. The new release fixes the issue with a new process.

  80. Lance Taylor said,

    Wrote on April 24, 2009 @ 8:54 am

    How come the emails show up as “nomail@nomail.com”…

  81. Valentin Brandt said,

    Wrote on April 24, 2009 @ 11:22 am

    Great plugin ! Thanks

  82. Andres Snitcofsky said,

    Wrote on April 24, 2009 @ 12:03 pm

    Very nice plugin!

  83. Shannon said,

    Wrote on April 24, 2009 @ 2:11 pm

    @Lance – The email addresses are unknown. We can’t pull them from Twitter. I hope that by displaying the ‘noemail’ link that people will click it and update the email address on your blog.

  84. Marcus Danillo said,

    Wrote on April 25, 2009 @ 11:49 am

    Really cool.

  85. ArtemR said,

    Wrote on April 28, 2009 @ 12:22 pm

    Excellent idea. Great work!

  86. Daniel Brierton said,

    Wrote on May 1, 2009 @ 5:53 am

    Sweet, I can add this alongside Facebook Connect and OpenID! :D

  87. Mark said,

    Wrote on May 2, 2009 @ 11:42 pm

    Testing – bit confusing; got the Twitter dialogue box and allowed… and now I’m back to the comment box without any indication of success. Am I logged in? I’ll say it and see I guess. Nope. Is twitter to busy?

  88. William Jones said,

    Wrote on May 3, 2009 @ 12:13 pm

    This is pretty cool and has a lot of potential. I wish it would automatically scroll back down to the comments section. It took a few seconds of waiting before I realized that I had to manually scroll back down to that section. Great work!

  89. prehack said,

    Wrote on May 4, 2009 @ 4:03 pm

    Cool.

  90. fine said,

    Wrote on May 10, 2009 @ 2:36 pm

    This is a test

  91. rainJosh Crain said,

    Wrote on May 14, 2009 @ 8:48 am

    hmm interesting

  92. swhitley (Shannon Whitley) said,

    Wrote on May 15, 2009 @ 5:10 pm

    Twitter Comment


    This Mashable/DISQUS login looks vaguely familiar – http://bit.ly/noXCS;) ([link to post])

    – Posted using Chat Catcher

  93. shawntsai said,

    Wrote on May 31, 2009 @ 8:24 pm

    Thanks. It’s really useful.

  94. J.J. García Zornoza said,

    Wrote on June 11, 2009 @ 6:01 am

    Great idea!

  95. whw7866 said,

    Wrote on June 20, 2009 @ 8:06 am

    I am studay it,it’s very good.thanks a lot

  96. Patrick Hunt said,

    Wrote on June 21, 2009 @ 7:39 pm

    Wondering how to make this work. I can’t get the redirect back to the same page as logged in.

  97. shahgeb said,

    Wrote on July 14, 2009 @ 4:38 am

    hi thanks i was looking this sort of application thanks

  98. Aalaap Ghag said,

    Wrote on August 20, 2009 @ 4:21 am

    Nice!

  99. monostereo said,

    Wrote on October 3, 2009 @ 8:49 am

    testing

  100. Most popular social media (cloud tools « Neaga Oleg) said,

    Wrote on November 3, 2009 @ 1:53 am

    [...] [...]

  101. deanpowers said,

    Wrote on January 3, 2010 @ 6:00 pm

    Let’s see if this Twitter Plugin for WordPress works. If it does, we’ll start on developers on doing the same thing for our Zope3 social collaboration software (Zojax)

    Pretty interesting this plugin knows your Twitter name and doesn’t even ask for your twitter password.

  102. deanpowers (deanpowers) said,

    Wrote on January 3, 2010 @ 6:03 pm

    Twitter Comment


    I just left a comment on Twitter Connect (sort of) at Shannon Whitley – [link to post]

    Posted using Chat Catcher

  103. twitter said,

    Wrote on January 7, 2010 @ 4:37 am

    Good wordpress plugin

  104. Kasun said,

    Wrote on January 29, 2010 @ 5:14 am

    Hi I’m developing blog for a client . I want to palce the twitter connect button some where other than diractly above the name field.

    I have two div elements , one in the left side with the comment form and the one in the right side with the twitter button.(Like techcrunch’s facebook button) I tried the placing the “” code, but for no success.

    If I tried to place it above the form it appears at correct place. But when I try to load it in the div on the right side it appears above the name field. Please help

  105. Using Twitter IDs for comments « dantwining.com said,

    Wrote on January 30, 2010 @ 2:33 am

    [...] So I think I might try Twit Connect, that in the spirit of all good things, does one thing and (hopefully) one thing well (for the record, I found out about this here, which led me to here). [...]

  106. Shannon Whitley said,

    Wrote on January 30, 2010 @ 1:13 pm

    @Kasun

    <?php if(function_exists(‘twit_connect’)){twit_connect();} ?>

    If you insert this code in your template, that is where the button should appear. If you changed the template on the Settings page, the “twc_connect” div is required.

    There is one other possibility. I wonder if the code in your comment section is being executed before your sidebar.

  107. Chris Perabo said,

    Wrote on February 17, 2010 @ 2:36 pm

    Oh, I am sad. I see this great “Sign in with Twitter” here below and I want it too. I never had this plugin before, but I just upgraded to WordPress 2.9.2 and then found this plugin.

    It did warn me that this plugin has not yet been tested with 2.9.2, but I installed anyway. I inserted the php code into the comments section, but when I go to install, I get the message,
    “Plugin could not be activated because it triggered a fatal error.”
    …and I am sad.

    I have PHP5, so that’s not the issue. Well, I hope I’ll get some support to get this running!

  108. Shannon Whitley said,

    Wrote on February 26, 2010 @ 1:43 am

    @Chris Perabo – I’ve just verified that Twit Connect does work with 2.9.2. It may conflict with another plugin that you have installed. If you deactivate all of your plugins, activate Twit Connect, and then reactivate each one, you can tell which one is the culprit.

  109. Ljudbildspel said,

    Wrote on April 5, 2010 @ 10:28 am

    Hi!

    I have problems with the author link. I want it to point to the author´s twitter profile (http://twitter.com/{username}).
    But it points to: http://mydomain.com/wp-admin/profile.php

    I have checked the author link tickbox.
    I´m pretty sure that it has been working before I updated to 2.08.

    Do you have any ideas?
    Have you heard this before or have I messed something up?

    I´m using the FB connect aswell and the author link works fine.

    eivind

  110. Shannon said,

    Wrote on April 5, 2010 @ 2:55 pm

    @Ljudbildspel – I just tested the author link. It works fine here. Have you tried it with a new user who has never logged in?

  111. Jason Lavigne said,

    Wrote on May 2, 2010 @ 11:51 pm

    Hi just testing to see how this works

Comment RSS · TrackBack URI

Leave a Comment

Name: (Required)

E-mail: (Required)

Website:

Comment:

Twitter Users!
Enter your personal information in the form or sign in with your Twitter account by clicking the button below.