Using my incredibly shoddy PHP skills, combined with my staggeringly shallow knowledge of WordPress I've put together a Widget that shows Name, Gravatar and Rep in an XBox Live "GamerTag" style display.

It's using a screen scraper as I couldn't see a better way to do it, but hopefully it should work for most people. I initially created it as something to use myself, so I haven't done a huge amount of testing, but if anyone has ideas/fixes/problems/anything else feel free to post.

More details and download here.

I've made a few changes in response to a few comments, and also removed the little place holder and badges in there. It takes into account badges that have been awarded multiple times, so it should be the same as your Stack Overflow page.

I've uploaded v2.0.0 to WordPress. It implements caching and uses the Stack Overflow JSON feed, rather than the old screen scraping method. This cuts the load on the Stack Overflow servers, reduces the data transferred to your blog and should make it less fragile if the Stack Overflow guys decide to rework the look and feel.

  • Please ask a more specific question. This is too general to be answered on this site
    – Eran Galperin
    Jan 9, 2009 at 23:28
  • It's not a question, it's a post about a Stack Overflow 3rd part tool, as per stackoverflow.com/questions/248296/… in the FAQ, and every other thing in the so-tool tag.. it's even tagged not-a-question! Jan 9, 2009 at 23:39
  • I've installed it and activated it, but I don't know how to configure it. I'm using WP 2.7. Jan 10, 2009 at 2:36
  • @nobody - If you go into Appearance, Widgets and add click Add, a box will appear on the right of the widget screen for you to configure it. Jan 10, 2009 at 7:11

2 Answers 2


According to the HTML standard, there is no _new as target. There is only _blank, _self, _parent or _top. So, it should be target="_blank" instead.

  • You're right, I was being an idiot.. and I write web apps for living :D Jan 12, 2009 at 10:10
  • Actually, target can also be used to specify which frame/window to use....
    – Kevin
    Feb 14, 2009 at 3:51
  • Yes Kevin, target specifies the frame or window, but there are 4 targets in the HTML standard who have special functions: _blank : new window/tab _self : in the same window or frame _parent : in the parent window or frame _top : in the root window or frame
    – Hinek
    Feb 19, 2009 at 13:29

Minor, but I couldn't see a reason why

$gravatar = str_replace("[HASH]", $hash, $gravatar);

is needed, why not just

$gravatar = '<img border="0" alt="Gravatar" src="http://www.gravatar.com/avatar/'.$hash.'?s=48&d=identicon&r=PG" height=48 width=48 />';

Also I think you're missing an underscore on:

  • It was that way because I had all the literal strings in one bit at the top as I was tweaking them.. makes sense to change it to the other way though, thanks. The other one is just a typo.. I'll change them.. Cheers Jan 10, 2009 at 16:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .