Popular Posts gadget for blogger

Sunday, December 20, 2009


Here is a gadget for your blog to show popular posts on your blog. The posts displayed are selected based the number of comments on the post. This gadget is customizable and you can show any number of posts.

To add this gadget to your blog go to > Layout > Add a Gadget > HTML/Javascript and add the below code :
<script type="text/javascript">
function pipeCallback(obj) {
document.write('<ol style="text-transform: capitalize;">');
var i;
for (i = 0; i < obj.count ; i )
{
var href = "'" obj.value.items[i].link "'";
var item = "<li>" "<a href=" href ">" obj.value.items[i].title "</a> </li>";
document.write(item);
}
document.write('</ol>');
}
</script>
<script src="http://pipes.yahoo.com/pipes/pipe.run?_render=json&_callback=pipeCallback&_id=1a1c6e4e6d4f148e3650fda46910e15f&url=http%3A%2F%2Fbloggerflick.blogspot.com&num=10" type="text/javascript"></script>
Replace the code in red with your blog url and num=10 indicates the number of posts to be displayed.

Now, save your gadget. This gadget does not works on all blogs try your luck or use Random Posts gadget for blogger.

Subscribe to our blog

Do you have any Suggestions, add your comment. Please don't Spam!
If you like this site >> Subscribe to our feed

0 comments:

Post a Comment