The Widget Code

Okay, there seems to be some demand for this, so here’s the code for the recent comments widget.

Updated to make copying easier and to fix a bug with anonymous commenters: In the end of the script, replace my URL with your own. Then all you have to do is add an HTML/Javascript widget to your sidebar and paste in the text.

You may not see comments right away, as my widget started by reading the comment feed prospectively only, but as people leave more comments, the widget should fill itself out.


<!– // hide from browsers
//Recent Comments Widget originally by Blogger Templates and updated by Blogger Buster then edited by Ben Zvan for simplicity
function showrecentcomments(json){
for(var i=0;i<show_number;i++){
var feed_raw=json.feed.entry[i];
var comment_link_raw;
for(var k=0;k<;k++) {
if([k].rel==’alternate’) {[k].href;break;
var comment_link=comment_link_raw.split(“#”);
var comment_link=comment_link.replace(/u003d/,”=”);
var post_link=comment_link.split(“/”);
var post_link=post_link.replace(/-/g,” “);;
var author_name
var author_link;
var author_out;
// Output phase

document.write(”+author_out+’ on ‘+post_out+’

// –>

var show_number=10;

The Widget Code
The Orbit is still fighting a SLAPP suit! Help defend freedom of speech, click here to find out more and donate!

7 thoughts on “The Widget Code

  1. 3

    Greg, I’m sorry. Blogger set up that widget as an app, which means I don’t see the javascript for it, just a GUI interface. You can try digging in the source code for the page to see where it comes from and whether you can get to it that way. That’s how I ended up with an editable script for this widget.

  2. 6

    Thank you for the simple but powerful comments widget. Every other ones failed or looked not quite right on my blog except this! :)Um, btw can I change the small-letter display post subject to normal one? (like when I type "Hello", I want to see it on my R/C widget exactly, not like "hello"….)

Comments are closed.