An unofficial blog that watches Google's attempts to move your operating system online since 2005. Not affiliated with Google.

Send your tips to gostips@gmail.com.

March 4, 2008

Top Commentators for a Blogger Blog

While Blogger doesn't encourage comments and communities, it's still interesting to see who comments on your blog more frequently. This information can be obtained from Blogger's comment feeds, but you need a tool for processing feeds.

Yahoo Pipes is probably the best way to combine, sort, filter and modify feeds. Inspired by this Yahoo Pipe, I created a pipe that shows the top 50 commentators from a Blogger blog, based on the most recent 5,000 comments. You can enter the URL of your blog and the number of top commentators, but the list is not generated instantaneously since Yahoo Pipe must fetch and process at most 10 GData feeds (Blogger's API doesn't include more than 500 comments in a single feed). The pipe could also be used to add the list of top commentators to the blog, using the JSON code generated by Yahoo.

Depending on the number of comments from your blog, the list may not be very meaningful. For example, if your posts get an average of 500 comments, this list will only reflect the hierarchy for the last 10 posts. To see the total number of comments from your blog, open this feed: http://BLOGNAME.blogspot.com/feeds/comments/default (replace BLOGNAME with the proper subdomain), view the page's source and search for "openSearch:totalResults". Google Operating System has 15,217 comments and the most recent 5,000 comments corresponding to the last 5 months.

Update. Here's some JavaScript code that uses Yahoo's JSON output. This could be easily added in a HTML/JavaScript page element from Blogger.

<script type="text/javascript">
function pipeCallback(obj) {
document.write("<ol>");
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=c92ac21897d8b56e61cfa85930dd89a1&url=http%3A%2F%2FBLOGNAME.blogspot.com&num=10" type="text/javascript"></script>

(merge the last two lines and replace BLOGNAME with your blog's subdomain name).

This blog is not affiliated with Google.