Twitter Avatars In Comments WordPress Plugin

Advertisement

Over the last months, Twitter has become extremely popular across the Web, with more blogs, magazines and companies using it to communicate with their audiences and customers. Even we started Twittering a couple of months ago and have over 3,650 followers now. Please feel free to join us and follow Smashing Magazine on Twitter1 Follow us on Twitter2 as well.

Although we aren’t sure if Twitter will actually revolutionize blogs (as other blogs claim3), Twitter is definitely changing the way website owners communicate with their visitors, and we, designers, need to be aware of that and use appropriate tools to meet the expectations of our clients. Unfortunately, there are not that many plug-ins4 and extensions for Twitter out there, so we decided to release one: the Twitter Comments WordPress Plug-In.

Twittar WordPress Plugin

The objective was quite simple: create a plug-in that uses Twitter to show avatars in comments in WordPress blogs. But after discovering the potential of the Twitter API, the plug-in evolved into a complete “avatar for comments” solution for WordPress. The plug-in was developed by Ricardo Sousa95, a young designer with a strong passion for WordPress and Joomla!.

Twitter Avatars on WordPress Comments Plugin6

Features

  • Loads user’s avatar by matching the email address to the user’s Twitter email address.
  • If user doesn’t have a Twitter account, it first tries to load user’s gravatar. If user doesn’t have a gravatar, it loads a default image. This is an optional setting.
  • You can set a 2-pixel border to the images (you choose the color).
  • You can choose the size: we suggest 24, 48 or 72 pixels.
  • You can set an image other than the default one to load if a user doesn’t have a Twitter account or a gravatar.
  • It builds a valid image for you (with alt and title attributes, etc.) based on user details.
  • Allows you to add a class to the image, so you can style it later.

Download the plugin for free

The plug-in is released under the GPL. You can use it for all your projects for free and without any restrictions. Please link to this article if you would like to spread the word. You may modify the plug-in as you wish.

Twitter Avatars on WordPress Comments Plugin7

Installation instructions

  1. Copy the “twitter” folder to your plug-in folder (wp_root/wp-content/plugins).
  2. Log in to your WordPress administrator panel, and activate this plug-in (click “Plug-ins” and then “Activate” near the plug-in title).
  3. Now you will need to edit your template’s comments.php file to show the avatar near the user comment.
    1. Click on “Appearance” and then “Editor” in your WordPress back end.
    2. Choose comments.php or comment.php or the PHP file that manages your user comments.
    3. Find the lines where the template manages the comments, and add the following line where you want to show the user’s avatar:
      <?php twittar(size, placeholderimg, border, class, usegravatar, rating); ?>

      Note: You may need to change your template. If your template already supports gravatars in comments, you will need to delete the gravatar tag and add twittar. You may need to make some adjustments in order to show the avatar properly.

      You must change the values inside twittar();. Here’s how:

      size
      The size of the avatar (in pixels). Just insert the number (e.g. 45), without “px.” It is the size for both width and height.

      placeholderimg
      The URL for the image you want to use when the user has neither a Twitter account nor a gravatar. Must be inside quotes (“”). Optional.

      border

      The color for the 2px border. Insert the hexadecimal code of the color (e.g. “#FFFFFF” with the “” marks) but only if you want to use one.

      class
      A CSS class that you want to use to style the avatar. For example: “myimg.” In the CSS, you would include .myimg { }. Put inside “”.

      usegravatar
      Just insert 1 if you want to use gravatars, and 0 if you don’t. If you choose to use gravatars, it will try to load a gravatar image if a Twitter account and picture is not found, otherwise it will load the placeholderimg (default) image directly.

      rating
      Parameter for gravatars only. Read more at www.gravatar.com.

      Note: if you want to skip a parameter and add another in front of it, just replace it with “”.

      Example:

      An example configuration could be:

      <?php twittar("45", "", "", "myimg", 1, "R"); ?>

      Recommended sizes for images: 24, 48 or 72 px.

    4. Save the file and enjoy Twitter avatars (see the image below).

Please feel free to post questions about installation in the comments.

About the author

The plug-in was developed by Ricardo Sousa95, a young designer with a strong passion for WordPress and Joomla!. You can follow him on Twitter10.

↑ Back to topShare on Twitter

The Smashing team loves high-quality content and cares about the little details. Through our online articles, books and eBooks and Smashing Conferences, we are committed to stimulating creativity and strengthening the web design community’s creative forces.

  1. 1

    Nice! Never seen anything like this before. Thanks for the plugin. I think plugins is kind of new category for freebies in SM, right?

    0
  2. 2

    Vitaly Friedman & Sven Lennartz

    January 8, 2009 5:22 am

    @Blogging2U (#1): that’s correct, we are going to try a number of different things in January.

    0
  3. 3

    Wow, great idea and great job Ricardo! There’s loads of Twitter users that don’t have gravatars so this could be very useful.

    0
  4. 4

    Nice plugin, I still get a lot of comments from people who don’t use Gravatar but do use Twitter.

    -1
  5. 5

    Great ideas! Both the Twitter avatars in comments plugin as well as plugins from Smashing Magazine in general.

    1
  6. 6

    Thank you Smashing for publishing this plugin and users for the good comments you have been giving. :)

    1
  7. 7

    Thanks for releasing this great plugins. fantastic idea!

    -1
  8. 8

    Very nice job! Thanks!

    0
  9. 9

    genius. been waiting for something like this for a while now. love that it’s inclusive of gravatar and doesn’t outright replace it.

    ciao,
    ‘enzo

    http://twitter.com/_enzo

    0
  10. 10

    Nice work, keep smashing :-)

    0
  11. 11

    Looking good. Thanks SM!

    0
  12. 12

    @Vitaly, that is an interesting approach. What happens if Twitter is down, it just finds the gravatar instead?

    0
  13. 13

    Great work – this and Tweetbacks will be awesome

    0
  14. 14

    That’s great!
    TNX!

    0
  15. 15

    I wish I were so talented as to actually understand these instructions ;)

    Very cool concept though!

    I do have Gravatar, so I guess I will stick with that for now.

    Bella
    Bella Casa blogs

    1
  16. 16

    Sounds nice, but here’s what I get after activating it and placing the code:

    Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /public_html/wp-content/plugins/twittar/twittar.php on line 178

    0
  17. 17

    Very nice idea to get multiple avatar providers. Icons, fonts, textures, and now plugins, I like this renewal. Smashing is really a valuable resource on the web.

    0
  18. 18

    Looks cool. I’m going to give it a try.

    1
  19. 19

    Raphael Camaprdou

    January 8, 2009 6:52 am

    In the same spirit, @tsaots created a WP plugin that greets you with your Twitter name. More info here.
    Neat concept, that can be developped:
    Why not greet the user via Twitter:
    “Hi Jon, I hope U enjoy reading my site. ++”

    0
  20. 20

    @Karolis Pocius: yes, you will need to have cURL (libcurl) support in your PHP for this to work. You might try asking your host for this. If you have a dedicated server, installing it should be easy.

    0
  21. 21

    Seems to work ! Great !!!

    0
  22. 22

    Nice? Does anybody find Twitter not cool? Like me?

    0
  23. 23

    great…. another great stuff from smashing magazine… thanks!

    0
  24. 24

    Thanx! Will give it a go.

    0
  25. 25

    This is quite nice, but the performance of it is utterly terrible. For each comment you will have two http requests server side and then one client side to load the image. This could perform a lot faster if you do the lot client side (going through a PHP proxy) and delay the display of the image until the page has finished loading. That way you don’t punish users that really don’t care too much about avatars but deliver quickly.

    1
  26. 26

    I agree with Chris that the amount of http requests this results in is unacceptable. I would however build in server-side caching. This will result in the best client side performance and it will also result in less load on the Twitter servers. That way everyone wins.

    0
  27. 27

    Wicked! too bad Smashing isn’t using this plug-in :P

    0
  28. 28

    @Chris Heilmann (#25) & @Marco (#26):

    Yeah. I thought about that too. However i wasnt able to come up with good solutions. I liked yours and will work to implement them :)

    @Chris W. (#12):

    Yes it will load gravatar instead.

    @Bella Casa (#15):

    Thanks. Anything i can help you with about instructions?

    Hope you enjoy it anyways.

    Thanks

    0
  29. 29

    Anyway this could work by Twitter name and not by email address?

    0
  30. 30

    How secure is the cURL usage in this plugin? Reason being, it could be a problem for non-techie bloggers that just “want twitter on their blog.”

    0
  31. 31

    @Chris Wallace (#31):

    Can you explain better what you mean? :)

    Thanks

    0
  32. 32

    I just tried to install the plugin on my WordPress blog. Everyone who had a Twitter profile image just showed up as “Image Not Found”. It was trying to pull the images from myblogdirectory/_bigger. Pretty sure that isn’t right. Everyone who had only a Gravatar icon showed up okay. What gives? Do I need to change some code somewhere in order to get things working properly?

    0
  33. 33

    Love it – will be implementing asap.

    0
  34. 34

    Thanks – appreciate it.

    0
  35. 35

    Kristen (#33):

    If it is getting the images from your blog it isn’t (but remember that user must input the twitter mail :) ). So if you don’t mind can you share your blog adress so i can check?

    Thanks

    0
  36. 36

    Nice plugin. Works like a charm.

    0
  37. 37

    Brilliant :)

    Thanks
    Alex

    0
  38. 38

    Cool idea. You could potentially extend this to other avatar services, and have an admin menu for specifying an order of preference that the avatars appear in – like some people might prefer gravatars over avatars.

    Think I’ll wait til a later version, based on some of the comments, but awesome work!

    0
  39. 39

    Testing…

    0
  40. 40

    @Laura (#39):

    Sure. I will add a couple more of things including the improvments in the global plugin way to do things so it can be more efficient. Thank you for your suggestions.

    Best Regards

    0
  41. 41

    I don’t know why peoples use twitter?…

    Anyways Thanks for sharing.

    Regards
    Omair Rais
    http://www.omairarts.com

    0
  42. 42

    Love the idea!
    However I am reluctant to have to modify my templates. I’d much prefer something I could configure via the admin panel.
    Would that be possible?

    0
  43. 43

    Also, could it not use the twitter username rather than an email address?

    Check out http://chinposin.com/ for more twitter avatar madness, you might be able to tie into that somehow too!

    0
  44. 44

    cool! and nifty.

    0
  45. 45

    Very nice plugin, and good post. :)

    -1
  46. 46

    This is genius because it limits the amount of default avatars in your comments without forcing your user to fill in an extra form field. Excellent release!

    1
  47. 47

    @Simon (#43):

    Sorry but it must be implemented throught Template the way the is right now. I will try to make something sweet that let you add it as a wordpress default avatar system so new wp themes already support without hacks but right now that is the way it works. Anyway you shoulnd’t be worried. Those are not risky hacks.

    Regarding username: It could but for me it doen’t make much sense because you would need a extra input field which is unnecessary. Anyway if you would like it drop me a mail throught http://www.ricardojrsousa.com

    Best Regards

    0
  48. 48

    @Ricardo (#36)

    Sure thing — here’s an example of an entry w/comments:

    http://kristenbyers.net/blog/?p=2198

    As you can see, people with only gravatars work just fine, Twitter avatars are MIA, and those with neither have the placeholder.

    0
  49. 49

    This plugin looks nice, when I examine the code, however, I realize that it sends a query per comment to the Twitter server. Did you know that Twitter only allows 100 request per hour. So if any post that has 20 comments is visited by 5 people than Twitter will block my web server for that hour period. Therefore this plugin is not usable right now. The plug-in must cache twitter avatars or urls for each email address, probably in database. You need to work on it Ricardo, it is useless now.

    0
  50. 50

    It would be good if the plugin could be modified to cater for both inline and background-images.

    0
  51. 51

    @Kristen (#49):

    Will try to understand what is the issue and will get back to you.

    @Baturalp (#50):

    Frankly i didn’t knew that but as i said in reply to previous comment i recognize that this is not the most efficient way even it being “a way”.
    I will add cache support to it ASAP.

    @John (#51):
    Is a idea :) Can be worked out. The main idea of the plugin was to be “as simple as possible” but it can be improved to get better performance and more options. I’m working on it ok? :)

    Best Regards

    0
  52. 52

    nice!

    -1
  53. 53

    @Ricardo Sousa – Great idea for a plugin, to extend on what Baturalp was talking about it would be good to add in database support so that while twitter is up and accepting links.

    The biggest issue that you will have is that people change their avatars on a regular basis so even if you cache or database the images, you will still have issues with updating each avatar when a twitter user changes it.

    Here is what I propose, because Twitter allows the 100 per hour API request you could initially grab the images for user comments (as requested from page views) as it does now, insert them into the database then set a part of the script to either incrementally grab the commenter images again over midnight (local time to the server wordpress install) in 100 user at a time blocks (this is inefficient) or to have the plugin re-grab the commenter image on next post (which is much more efficient and puts less load on twitter and web server).

    Of course the latter would also need to be described as a limitation due to twitter’s current API allowances.

    The third option to yourself is talk to Twitter…
    Because you aren’t requesting the actual IM text from a tweet and only grabbing the image for a specific twitter user they may work with you to come up with a more viable solution (they have done this in the past).

    All I can say it is an awesome start and good luck in updating it!

    0
  54. 54

    Very nice plugin !

    0
  55. 55

    I should include that “cache” does not mean to save a piece of information forever, contrarily it should save information for a limited period of time, like @Regravity said. Because original data might change in time. Therefore you should decide the timeout period for caching, which must not exhaust people’s web server. On the other hand, you should treat nice to twitter’s servers. :)

    Good luck!

    0
  56. 56

    Great plugin, thanks alot.

    0
  57. 57

    testing to see if this does work

    0
  58. 58

    super dooper … downloading now!

    0
  59. 59

    The showUser() requires an e-mail address, but trackback comments without e-mail addresses pull up someone’s Twitter avatar. Adding a check for this on line 34 fixes the problem.

    0
  60. 60

    If you use the filter ‘get_avatar’ and this code, you dont need to modify your comments.php code.


    function change_get_avatar($avatar, $id_or_email, $size, $defailt, $alt){
    if (function_exists("twittar")) {
    twittar($size, "", "", "myimg", 1, "R");
    return false;
    } else {
    return $avatar;
    }
    }
    add_filters('get_avatar', 'change_get_avatar');

    If you have Twittar plugin active you use the Twitter Avatar and if not active you use get_avatar() function.

    0
  61. 61

    @aNieto2k (#61):

    Thanks. After release that first version i found that and is added on top of version 2.0 that will be released soon with new features and total controll of settings from backend. Anyway this tip is only valid to recent templates. Must of them don’t even use gravatar neither the get_avatar function.
    I will add all the options and change the documentation.

    Thank you very much.

    I will reply to other questions as soon as i get home as i am out right now.

    Thank you all and wait while i talk to twitter regarding the newest versiont that i promisse will be much better.

    Ricardo

    0
  62. 62

    Awesome plugin – thanks!!

    0
  63. 63

    @Regravity(#54) & @Baturalp(#56):

    Regarding your informations i’m thankful for them.
    I’m working with twitter (i mailed them) in order to find a solution. Cache will be added (actually it is already added) but the question here is to find an efficient way to make the updates. I’m thinking about create a dummy twitter account. Login will be encrypted and we log on twitter before doing the updates. This account will have (i’m hoping) no limits or better ones.
    So the plugin will load the img adress when the user make the comment and then update in a certain date & time. The big question here is if i can know remotly when the photo is updated. Working on better solutions and willing to hear from you users, as we speak.

    Thanks

    0
  64. 64

    This sounds cool !

    0
  65. 65

    I have made a litter modification for this plugin to have database support.

    0
  66. 66

    @Denis (#66):

    This will be added in the next version. Would you like o share with me what you did? if so please mail me to blog[at]ricardojrsousa.com just to see if is different from mine.

    0
  67. 67

    I still can’t get the plugin to work on my blog, no matter which theme I use. Is it possible that Twittar isn’t compatible with another one of my plugins?

    0
  68. 68

    Is there anyway this could work oppositely, It try’s to load gravatar first and if it cant it uses twitter?

    0
  69. 69

    Cristian Castellari

    January 14, 2009 5:19 am

    I’m having a trouble. I set the plugin correctly, but the placeholder image for a users that has not twitter or gravatar is still the gravatar default.

    I want use a custom placeholder image and gravatar too compatibility. The params i use are the followings:

    twittar(48, “http://www.skyflash.it/wp-content/themes/freshnews/images/gravatar.jpg”, “#cccccc”, “gravatar”, 1, “”)

    0
  70. 70

    @Kristen (#68):
    Excuse me. I’ve been a little busy lately so i completly forgot to get back to you. Are you willing to create an admin (temporary) acccount and send me the details to blog[at]ricardojrsousa.com so i can test in on place and see what is wrong? If so please do it otherwise please post here the exactly code you copied into your comments.php file and confirm that the user for which the default avatar is being given has a twitter account. I can see that there are a user which has the gravatar img so if there are a problem should be with twitter.

    @Conorp (#69):
    I’ve been debating myself with that question. Should i do it or not? Will it be against the initial intent of the plugin? The awnser is yes but i think user should have the option to choose so for the next version this feature will be added. (Totally redisigned params and code). So just way some more days (Check bellow)

    @Cristian (#70):

    May I have your site adress? If you think it’s better plz mail me to blog[at]ricardojrsousa.com with all the info you may be able to provide.

    NEW VERSION:

    Regarding the new version. I’ve been today trying to contact Twitter team so i expect to release the new version within a week. Actually it should be earlier but better give myself a 1 week timeframe. You want more info regarding what exactly it will have improved? Mail me blog[at]ricardojrsousa.com and i will be more than happy to provide you with that info.

    Best Regards,

    Ricardo Sousa

    0
  71. 71

    Cristian Castellari

    January 15, 2009 1:20 am

    @Ricardo: sure! Mi blog is http://tinyurl.com/7n7h6c
    For better explanation, i left both images:
    the first column is the gravatar built on the blog template. You may see the default icon i’m using and some gravatar users.
    The second column is the twittar plugin. You may see some icons from twitter users AND a gravatar default icon which is not that i declared in the plugin activation code.

    If i use “0″ instead of “1″ in the usegravatar option, the default icon is good, but i lose the gravatar compatibility

    P.S.: may i suggest an “alt” function in the plugin, wich displays a message like “Come see my $twitterprofile and follow me!” when the mouse hovers the icon?

    0
  72. 72

    That is really awesome, I really like this idea!

    0
  73. 73

    Solved! Was a my mistake! I’ve forgot the ” ” for the size parameter.

    0
  74. 74

    @Cristian (#74):

    Sorry for delay. Glad you solved!

    All other issues:

    i will be out for the weekend but will get back to them ASAP.

    Ricardo

    1
  75. 75

    @Ricardo (#71): Just figured out the problem this morning! I finally figured out how to upgrade my host to PHP 5.0 and it solved a few minor problems I was having. Might be useful information for troubleshooting other users in the future.

    The plugin is working great now, thank you!

    0
  76. 76

    So is there a future update coming out to use “alt”?

    0
  77. 77

    @DoctorFu:

    Hope to have one till the end of the week.

    Cheers

    0
  78. 78

    Nice, tnx

    0
  79. 79

    Thank you very much for this interesting Plug-In. I think, I`ll try it out.
    Greetings
    Boris

    0
  80. 80

    Nicolas TAFFOREAU

    January 26, 2009 3:04 pm

    Nice plugin, thank’s ! But i’m using Gravatar.

    0
  81. 81

    I’ve installed the plugin but am unable to get the twitter avatars to show up…

    The default and gravatar images work… the twitter ones do not.

    I’ve tested this by changing my email address on one of the comments to match my email address used on twitter.

    I’m also using php5

    Any ideas on what could be wrong?

    0
  82. 82

    Does this also give the user the option to send a tweet with the comment at the same time – nice plugin

    0
  83. 83

    fascinating and informative, but would make something more on this topic?

    0
  84. 84

    Is this compatible with WordPress 2.7?

    I only have 50)); ?> in my comments.php that refers to avatars.

    Please make it compatible with WordPress 2.7 :)

    0
  85. 85

    This plugin is great. It was working under WP 2.7 but no longer works under WP 2.7.1 Any intentions on updating it?

    0
  86. 86

    I was wondering how this plugin might work with themes that use the wp_list_comments() function instead of legacy comments. I can’t figure out what to edit in order to insert the Twittar code.

    0
  87. 87

    Are you using this plugin?

    0
  88. 88

    Michael SteelWolf

    March 5, 2009 5:40 am

    Same question as Suz above.

    0
  89. 89

    Cool

    0
  90. 90

    I can’t see how to make this plugin work using WordPress 2.7.1.

    The only lines of code I can find for comment templates in my theme’s comments.php file are as follows:


    php wp_list_comments('avatar_size=60&type=comment');

    I can’t do anything with that????

    The only place I have found to actually alter the layout/styling of the comments is in the wp-includes/comment-template.php file. If I add the Twittar code to that page it doesn’t work, presumably because it is outside my theme folder, and breaks the Blog code.

    Surely someone else has run into this problem?

    If it helps, I’m using the “Gazette” Woo Themes” theme.

    Any help would be greatly appreciated.

    0
  91. 91

    Is this plugin still being developed?

    0
  92. 92

    Terrance Charles

    April 2, 2009 10:50 am

    Perfect, hell of a great post, I needed this. Going to add it to my blog now ;-)

    Terrance Charles

    0
  93. 93

    Looks like a great plugin, I’ll be using it on my site soon :-)

    0
  94. 94

    thanks…

    0
  95. 95
  96. 96

    I don’t think this works anymore. Is there an alternative?

    The email parameter has been deprecated
    /users/show/show.xml?email=xxx@xxxxxx.com

    0
  97. 97

    I really like this idea, but can’t get it work on my site with wordpress 2.7.1. Any plans for an update?

    0
  98. 98

    How about a register to your wordpress blog plugin? Throw in a checkbox says “log in from twitter” click opens up a button says connect from twitter. You click, it opens oauth, you accept. Your registered. Now your comments show up with your avatar and you can retweet from the comments form.

    0
  99. 99

    Great idea. Have to see it working to say more.

    0
  100. 100

    Haha – I just needed to add a comment on this post as I think it would be great running it on my blogs. If I can get it to work :-) And off course for the fun seeing it in action. Great idea Ricardo – and thanks for having worked at it.

    0
  101. 101

    Hi, I just can’t make it work. It gets the gravatar image but not the Twitter image.

    0
  102. 102

    Hi,
    Great plugin but i have some error with it.
    after installing the plug in i have add the code line but got this error:

    Parse error: syntax error, unexpected T_CLASS in /wp-content/themes/Digital-Statement/comments.php on line 26

    and line 26 is thae line the you have told to add here.
    Please help.
    Thanks

    0
  103. 103

    This could be an interesting addition to the blog. I’ll check it out some more. Does it slow down the blog page load at all?

    0
  104. 104

    It didn’t work for me. It should grab my twitter icon based on email address, right?

    0
  105. 105

    Fantastic…gonna try it

    0
  106. 106

    Forgive me for wasting your time but I am eager to get this plugin working and can’t manage it. I think I need to be walked through these two tasks:

    1) Exactly where to insert line in comments.php
    2) How/where to find/delete gravatar tag.

    Sorry to be such a bother and dummy. But the help would be greatly appreciated.

    Best,
    Dan

    Best,
    Dan

    0
  107. 107

    thank you, that is exactly what i was looking for

    0
  108. 108

    Thanks a lot, i´m trying it i my blog :P

    0
  109. 109

    Is it magic ?

    0
  110. 110

    Any plans on updating the plugin? It would be awesome.

    0
  111. 111

    我试验一下

    0
  112. 112

    its pretty useful.. thanks

    0
  113. 113

    Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/user/public_html/wp-content/plugins/twittar/twittar.php on line 178

    And you haven’t bothered to update the plugin since January, despite promises to the contrary.

    FAIL.

    0
  114. 114

    it sucks that * I * can’t find where to insert:

    ):

    I installed a theme called modularity and I can’t find the comments template. Shit.

    Any ideas?

    0
  115. 115

    YEAH! I’ve found it buut now my Twitter avatar is not being displayed. ¬¬

    0
  116. 116

    as a matter of fact no twitter avatars are being shown. : O

    I copied the folder via FTP to the plugins folder, I activated the plugin through the wp-admin, and then I changed this line in comments.php:

    twittar(“75″, “”, “”, “avatar avatar-75 photo”, 1, “R”); //echo get_avatar( $comment, 75 );

    Help? This plugin seems to rock. What do the users have to put? The twitter registration email address or something?

    0
  117. 117

    It’s working because if I set the “usegravatar” parameter to (int)0 I don’t see a friend’s avatar, but if i set it to true boolean way I do see her gravatar, but it’s not her Twitter avatar.

    I used my email in a comment but my Twitter avatar is not displayed.

    0
  118. 118

    If i do the XML request directly from my browser to Twitter I get:

    /users/show/show.xml?email=john@twitter.com
    The email parameter has been deprecated

    Isn’t Twitter accepting email as parametters anymore?

    0
  119. 119

    I just realized your plugin is not going to work as long as Twitter doesn’t want to take that parameter.

    USELESS. sorry to say that.

    0
  120. 120

    dude, let’s try to do it some other way, I’ve found this information for you:

    http://code.google.com/p/twitter-api/issues/detail?id=411

    Key is here now:

    http://twitter.com/users/username.xml

    0
  121. 121

    You know, I could just change your plugin name and keep all the credit, but here’s your fix bro!

    Find in wp-content/plugins/twittar/twittar.php and change this:

    function showUser($id){
    // Will arrange the url we need to open @ twitter to get the photo info
    $request = 'http://twitter.com/users/show/show.xml?email='.urlencode($id).'';
    // Will open another function that will do all the hard work :)
    return process($request);
    }

    for this:

    function showUser($id){
    $id = explode('@', $id);
    $id = $id[0];
    // Will arrange the url we need to open @ twitter to get the photo info
    $request = 'http://twitter.com/users/'.strval($id).'.xml';
    // Will open another function that will do all the hard work :)
    return process($request);
    }

    Links or credits are welcomed. ( :

    Now, we can specify in a Label something like..

    Email (to use Twitter enter youryoursername @twitter.com)

    And then everything will match.

    0
  122. 122

    dude, lol…

    you’re not gonna show my contribution to your script???

    it didn’t work until I showed you how, you know? Be FAIR.

    0
  123. 123

    Hi,

    Tried this above but the Twavatar plugin works easier.

    0
  124. 124

    I was wondering if anyone has tried Twittar on the Magazeen theme that Smashing released recently. I can’t seem to get this to work. I am sure it has something to do with the magazeen_comments function, but I have no idea what. Thanks for the help!

    0
  125. 125

    Has this been setup on the smashingmag blog? I’ve just posted my comment here using my twitter email. fingers crossed

    it didn’t work :(

    0
  126. 126

    Hello,

    I’m sorry for so long-time with no replies for you all.
    I’ve been dealing with some personal issues that come into the way and drove me away from development work.
    I’m now quite “Back to Work” and I’m ready to present the version 2 of this plugin which will not only fix tons of the issues reported but also present a more efficient way to get the avatars. This version is already ready but need some testing and fixing prior to release.

    I’m going off for a week or so to enjoy some (deserved) vacations. Then I will be releasing 2.0 version of Twittar ;) The fix eliezer presented should work just fine in the meanwhile.

    ————————————————
    READ THIS:

    Now the important part:
    Whoever mail me at: blog@ricardojrsousa.com within next week will be not only the first to receive Twittar2 but will also get free install of the plugin. Yes, I’m installing twittar in each one of your websites on your request.
    If you do not wish the install but just the plugin you can tell me that on the mail…

    As soon as i get back I will start those installations as my primary to-do.

    Twittar2 will be released in this page for everyone else in the 5 days following the 1st hand release for those who mail me.

    ————————————————-

    Some new about Twittar2:
    - Now include backend;
    - No need to edit que comment.php file anymore;
    - Stores avatars for better managing;
    - Options to refresh avatars ;)
    - Many more settings;
    - Linking to twitter when click the avatar will be possible;
    - and more…

    Thanks!

    I hope you can forgive me ;)

    Ricardo

    0
  127. 127

    Great idea – too bad it doesn’t work!

    The email parameter has been deprecated: Test for yourself

    It will only work if you can capture the user’s twitter username/id/screenname in addition to their email.

    0
  128. 128

    YEAH! I’ve found it buut now my Twitter avatar is not being displayed. ¬¬

    0
  129. 129

    What if I have both Gravatar and Twitter?

    (EDIT-> shows Gravatar)

    0
  130. 130

    will you be able to get this to work again?

    0
  131. 131

    test

    0
  132. 132

    I think this is not working

    0
  133. 133

    What does this use?

    0
  134. 134

    Thanks!!!

    0
  135. 135

    Hey,

    I have actually just created a WordPress plugin that does exactly what’s described above, but circumvents the problems with the above plugin since Twitter changed their stance on allowing to search by email address.

    You can find it here http://wordpress.org/extend/plugins/twitter-avatar

    Let me know what you think, cheers,

    Thomas

    0
  136. 136

    If I understand you well, this plugin shows the Twitter image when you have both an Avatar and a Twitter icon. I figured you would use this yourself on this blog, why don’t you? At least it seems that you don’t use it here (no links, no mouseovers with info). EDIT>>> Avatar icon is used on this site instead of Twitter, but not sure its the same plugin here

    Hint: there are also plugins that can take @yourname and auto-turn it into a Twitter.com/yourname link, as with @Kandura (my twitter name).

    I like this plugin, thanks!

    0
  137. 137

    muito legal isso! verry good! where are my pic of twitter here?

    0
  138. 138

    Great, I get it :)

    0
  139. 139

    testing

    0
  140. 140

    i cant get this thing to work….i have to put it on my functions.php page instead…is this right?

    plus when i did it, it didnt work :(

    0
  141. 142

    Testing to see how it all turns out .

    0
  142. 143
  143. 144

    That is great! It really helpful

    0
  144. 145

    Is there any way to make it work with the WordPress Thread Comment plugin? The avatar doesn’t show up in the reply thread.

    ..BLOGBloke

    0
  145. 146

    Очень нравится.

    0
  146. 147

    Has anyone else reported that this ‘hack’ appears to conflict with ALL other plugins installed on their blog? I received the following error once I added the code to my functions.php file:

    Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at /home/—-/public_html/wp-content/themes/—-/functions.php:7) in /home/—-/public_html/wp-content/plugins/*pluginname*/*pluginname*.php on line 1966

    I tried de-activating plugins to see if it was specific ones but the same error was always present, just with the next plugin instead.

    This looks like a great plugin so any ideas what the problem is and how it can be resolved?

    Thanks! Gemma

    0
  147. 148

    Sadly, it doesn´t work. Tried Elizers workaround with WP2.9 and it´s a no go. It sure picks upp a twitter avatar, but it isnt the right one.

    When I look in the author profile for that comment I get the correct url to the avatar, but somebody elses is used in the comments field.

    This is what is picked up in the comments: http://a1.twimg.com/profile_images/19932962/Photo_5_normal.jpg and this is the url in the author profile for that comment: http://a3.twimg.com/profile_images/560114545/parkering-forbjuden_bigger.jpg (the one it should be)

    Ricardo seems to be on a long vacation, since there hasn´t been any updates yet.

    0
  148. 149

    An update for WP2.9 would be great. Otherwise, this is dead in the water :(

    0
  149. 150

    I’ve come across a small handful of blogs that use something similar, only it allows you to sign in using either A) Gravatar B) Twitter C) Facebook or D) OpenID (I think)

    And I can not for the life of me remember which blog it was I used it last on… I’d like to find this so that I can use it as well.

    Any ideas???

    0
  150. 151

    Very very usefull info. I think this is a ‘TOP1 Article into Build Link Popularity. Keep going!

    0
  151. 152

    testing testing

    0
  152. 153
  153. 154

    This doesn’t work due to changes in the Twitter API.

    The script tries to find Twitter account information via:
    http://twitter.com/users/show/show.xml?email=email@address.com

    However, Twitter have stopped allowing searches based on the email address, so therefore this sadly can no longer be done. You can however use the following URL to grab the Twitter avatar based on the screen name, but you will need to ask for this information from the user in the comment form. See this URL:
    http://twitter.com/users/show/show.xml?screen_name=jamiebicknell

    0
  154. 155

    Antonio Bustamante

    February 7, 2010 7:11 am

    Jamie is totally right, the parameter ‘email’ was deprecated in the Twitter API, and there is no practical way to do it. You could try to perform a ‘search’ according to the nickname of the visitor, but that requires authentication. It’s a shame, but I guess spammers found a way to take advantage of that feature.

    My suggestion is that Smashing Magazine should modify the plugin for it to work at least with Gravatar (but you don’t need a plugin for that)… so maybe a small warning message to the visitors regarding this situation?

    0
  155. 156

    Can you provide more information on other wordpress plugins, or do you have some resources you can share with us where we can find such useful stuff? Thanks.

    0
  156. 157

    thank youuuu saolun

    0
  157. 158

    thanks!

    0
  158. 159

    thankyouuu

    0
  159. 160
  160. 161

    Nem funciona :/ Don’t works

    0
  161. 162

    Does Smashing Magazine use this method?

    0
  162. 163

    testing

    0
  163. 164

    Holy shit, can somebody update this post saying this plugin does NOT work anymore? before anyone else, like me, wastes an hour trying to get it to work, only to find out the hard way…

    0
  164. 165

    Looks like Twitter deprecated the email parameter in its API call, so the showUser($id) function no longer works. Too bad, really, because this looked like a pretty cool plugin.

    0
  165. 166

    I like to post this comment .It helps a lot.The one thing I do know for sure, if that day comes, is that when it’s wedding cake cutting time, I will NOT make the same mistake I witness at every wedding. I will not be serving Champagne with dessert, but rather the slightly sweet and fizzy dessert wine,..

    Thanks and Regards

    0
  166. 167

    Fine-sharing have been, thank you…

    0
  167. 168

    Im going make a test. :)

    0
  168. 169

    Failed

    0
  169. 170

    It’s not working :/… The Twitter API has been updated!

    0
  170. 171

    Hey Ricardo,

    Hope this works nicely with WP 3.x. Gravatars and Twitcons. Nice.

    Rats….Jamie Bicknell and other report that changes at Twitter will make this not work nicely. What a shame.

    Cheers,
    Tim

    0
  171. 172

    Hi great plugin thanks!

    0
  172. 173

    Testing

    0
  173. 174

    prova

    0
  174. 175
  175. 176
  176. 177

    Does this works with WAMP? I don’t know why but on my ‘local’ I have everyone ‘without twitter like ‘ – with default avatar:-(
    P.S. php_curl works

    P.S. Twitter api change!!!!!!!!!!!!!!

    0
  177. 178

    i don’t get it:
    comments are displayed with the wordpress command
    how am i meant to ‘Find the lines where the template manages the comments, and add the following line where you want to show the user’s avatar’?

    0
  178. 179

    Wow! Just testing

    0
  179. 180

    I want to try this, but I’m a little confused…

    1) Does this work with Disqus? (for people who don’t already have an avatar)

    2) Does this plugin ONLY apply to people who have no avatar? I don’t want it to replace existing avatars with a twitter one, just to be there in case someone doesn’t have one at all.

    If the answers to both of those are yes, then I’ll install it.

    0

↑ Back to top