function showrecentcomments(json) {
  // start a loop
  // in this loop we get the entry from the feed and parse it
  for (var i = 0; i < numposts; i++) {
    // get entry i from feed
    var entry = json.feed.entry[i];
    // get the posttitle
    var posttitle = "";
    // get the post url
    // check all links for the link with rel = alternate
    var getposturl;
    if (i == json.feed.entry.length) break;
    for (var k = 0; k < entry.link.length; k++) {
      if (entry.link[k].rel == 'alternate') {
        getposturl = entry.link[k].href;
        break;
      }
    }
	var alturl = getposturl;
	   //alturl = alturl.replace("#", "#comment-");
	   var postlink = alturl.split("?");
	   postlink = postlink[0];
	   var linktext = postlink.split("/");
	   linktext = linktext[5];
	   linktext = linktext.split(".html");
	   linktext = linktext[0];
	   var posttitle = linktext.replace(/-/g," ");
	   //posttitle = posttitle.link(postlink);this line was adding link to post title
	var tempurl = getposturl;
	   var templink = tempurl.split("?showComment");
	   templink = templink[0];
	   posturl = templink;
	   posturl = posturl + '#comments';                                            
	// Get the Author URL
           var authorurl = "";
	if ( entry.author[0].uri ) {
	   authorurl = entry.author[0].uri.$t;
        }
    // get the postdate, take only the first 10 characters
    var postdate = entry.published.$t;
	   var year = postdate.substring(0,4);
	   var month = postdate.substring(5,7);
	   var day = postdate.substring(8,10);
	   var monthnames = new Array();
	   monthnames[1] = "Jan";
	   monthnames[2] = "Feb";
	   monthnames[3] = "Mar";
	   monthnames[4] = "Apr";
	   monthnames[5] = "May";
	   monthnames[6] = "Jun";
	   monthnames[7] = "Jul";
	   monthnames[8] = "Aug";
	   monthnames[9] = "Sep";
	   monthnames[10] = "Oct";
	   monthnames[11] = "Nov";
	   monthnames[12] = "Dec";
    // get the post author
    var postauthor = entry.author[0].name.$t;
    // get the postcontent
    // if the Blogger-feed is set to FULL, then the content is in the content-field
    // if the Blogger-feed is set to SHORT, then the content is in the summary-field
    if ("content" in entry) {
      var postcontent = entry.content.$t;}
    else
    if ("summary" in entry) {
      var postcontent = entry.summary.$t;}
    else var postcontent = "";
    // strip off all html-tags
    var re = /<\S[^>]*>/g; 
    postcontent = postcontent.replace(re, "");
    // reduce postcontent to numchar characters
    if (postcontent.length > numchars) postcontent = postcontent.substring(0,numchars);
    // display the results
    if (showcommentdate == true) document.write('On '+ monthnames[parseInt(month,10)] + ' ' + day + ' - ');
    if (authorurl != "" ) document.write('<a href="' + authorurl + '"><b>' + postauthor + '</b></a>' + ' Commented ');
    else document.write('<b>' + postauthor + '</b> Commented ');
	if (showposttitle == true) document.write('on : ' + '<a href="'+ posturl +'">' + posttitle + '</a>');
	document.write(' - "<i>'+ postcontent + '...</i>"<br/>');
	document.write('<br/>');
  }
    //document.write('<div style="font-size:75%;text-align:center"><a href="http://www.corpseofattic.com">Add this widget to your blog</a></div>')
}
