Monday, August 17, 2009

Show Popular posts on Blogger

Popular Posts widget on Blogger uses Pipes , a feed and content aggregation tool from Yahoo. It fetches the Comment feeds and find outs the most commented post.

Follow this steps:

1. Login your blogger.

2. Click Customize.

3. Click to Add A Gadget and select HTML/JavaScript.
You have to paste the following code into it , after making the necessary changes.


<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=1cf38ae68efbe859c4ba1ee239cec099&
url=http%3A%2F%2FYOUR URL&num=8"
type="text/javascript"></script>

4. You have to change YOUR URL with your URL and the number 8 with the required number of posts.

Save your template and preview the Popular posts widget .

No comments:

Post a Comment