I had tried so many ways to put this widget on, but it was not working and I almost give up.
Luckily, I found this script that make it works.
Follow this instruction:
1. Go to your Dashboard.
2. Choose Page Elements
3. Click Add a Gadget
4. Choose HTML/Javascript
5. Copy and paste this code:
<script style="text/javascript">
function showrecentcomments(json) {
var numcomments = 5;
var showcommentdate = true;
var showposttitle = true;
var numchars = 100;
for (var i = 0; i < numcomments; i++) {
var entry = json.feed.entry[i];
var alturl;
if (i == json.feed.entry.length) break;
for (var k = 0; k < entry.link.length; k++) {
if (entry.link[k].rel == 'alternate') {
alturl = entry.link[k].href;
break;
}
}
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);
var commentdate = entry.published.$t;
var cdyear = commentdate.substring(0,4);
var cdmonth = commentdate.substring(5,7);
var cdday = commentdate.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";
if ("content" in entry) {
var comment = entry.content.$t;}
else
if ("summary" in entry) {
var comment = entry.summary.$t;}
else var comment = "";
var re = /<\S[^>]*>/g;
comment = comment.replace(re, "");
document.write('<br/>');
if (showcommentdate == true) document.write('On ' + monthnames[parseInt(cdmonth,10)] + ' ' + cdday + ' ');
document.write('<a href="' + alturl + '">' + entry.author[0].name.$t + '</a> commented');
if (showposttitle == true) document.write(' on ' + posttitle);
document.write('<br/>');
if (comment.length < numchars) {
document.write('<i>');
document.write(comment);
document.write('</i>');}
else
{
document.write('<i>');
comment = comment.substring(0, numchars);
var quoteEnd = comment.lastIndexOf(" ");
comment = comment.substring(0, quoteEnd);
document.write(comment + '...<a href="' + alturl + '">(more)</a>');
document.write('</i>');}
document.write('<br/>');
}
document.write('<br/>');
}
</script>
<script src="http://xyz.blogspot.com/feeds/comments/default?alt=json-in-script&callback=showrecentcomments">
</script><a href="http://reviewofweb.com/blogging/recent-comments-blogspot-widget/">Widget </a>by <a href="http://reviewofweb.com/">ReviewOfWeb</a>
Good luck! :)
(Credit to: ROW)
thanks for sharing this!!
ReplyDeleteand HAPPY MONDAY to you!
hope it's useful :)
ReplyDeletehappy monday to you.
view my version too ^^ (not mine actually but my tutorial post)
ReplyDeletehttp://www.jejaktrend.com/2009/11/recent-comment-20.html
eh eh.. en3 jenis "How To" plak.. hehe
ReplyDeleteeldy - yours is good, too. editable :)
ReplyDeletetupai - haha. entah kenapa boleh jadi macam tu. how's life?
ReplyDeleteWhat widget you are trying to add again? I thought it was comment but it must be somethingelse.
ReplyDeleteThank you for the tip, indeed there is so much to learn in this blogoland :)
Thanks for sharing although I won't putting it up anytime soon : )
ReplyDeleteI'm using intense debate's recent comment's plugin so no problemo lor.
ReplyDeleteocean girl - it's a Recent Comment widget :) you should try it. cool.
ReplyDeletefoong - too messy eh? :)
ReplyDeletetekkaus - i realize that i'll have problem to comment in your blog when my internet connection is slow. why eh?
ReplyDeleteМоя история из жизни: мы как-то с мамой ехали в маршрутке,( мама спец по всем видам мяса на глаз определяет что это), на остановке залазит подвипывший мужик с куском свежака в одноразовом пакете. Едем. Маршрутка резко тормозит,мужик по инерции бежит вперед и пакет рвется ,оттуда выпадет свежак ,дальше мамины слова- " Мужчина,у вас вымя выпало!" я медленно сползаю под сиденье , пассажиры ржут, мужик красный - выбегает на следующей остановке :)))
ReplyDeleteHi Faisal,
ReplyDeleteWe see that you have used our Recent Posts widget code but removed our credit code at the bottom . As per our terms (http://reviewofweb.com/blogging/recent-posts-blogspot-widget/)it is not allowed to remove the credits.
Please put the entire code as it is in your blog post (with credits).
Thanks!
row - edited as you wish. if you realize, i've put the credit below the post.
ReplyDeletethank you.