Sunday, 13 April 2008

Popular Posts (Most Commented) Widget for Blogger Blogs

Here is a Popular Posts widget for Blogger blogs which displays a list of the ten most commented posts. This works by parsing the last 5000 comments which have been made on your blog; the post titles and URL are extracted and displayed in descending order of popularity, followed by the comment count of this post.

Over the past few weeks, many of you have expressed an interest in such a widget, and I hope this will become a useful widget for you all.

You can see this widget in action and install this in your own Blogger powered blog using the widget installer below.






Please note: if you are reading this post in your feed reader, you will not see the widget installer and will need to visit this page in your browser instead!



Widget by Blogger Buster
On the right you can see an example of the Popular Posts widget, which displays the ten most popular posts from Blogger Buster (including their comment count). This widget uses Yahoo! Pipes to parse and display each item in the list using the last 5000 comments which have been made on this blog.

Update: I've just changed the mark-up of the widget to capitalize only the first letter of each word in the post titles (thanks to Angel's great advice!)

Installing this widget in your own Blogger blog is easy:

  1. Change the title of the widget if you prefer.

  2. Add your blog's URL in the input box (don't include the http:// part as this is already inserted by the script)

  3. Click the "Customize" button to make the changes take effect, then click on the "Add to Blog" button.

At this point, you will be taken to the widget installer page where you can choose which of your Blogger powered blogs you would like to install this widget.

O Ricardo traduziu este widget para Português que pode ser encontrado nesta página.

A bit more information about this widget

I have developed this widget using Yahoo Pipes, where I added variables to retrieve 5000 comments and extracted the titles and URLs using Regex (regular expressions).

If you would like to take a look at how this works, feel free to hop over to the Blogger Popular Posts/Most Commented Pipe page where you can also make a copy and edit to your own specifications.

Using This Widget in a Blogger Feed Widget (Alternative Installation)

If you would prefer to use Blogger's Feed Widget instead (which loads the items slightly faster), you modify the following feed link to include your own URL (eg: yourblog.blogspot.com or www.yourblog.com) and add insert this as the "Feed URL" on the widget configuration page:

http://pipes.yahoo.com/pipes/pipe.run?_id=1cf38ae68efbe859c4ba1ee239cec099&_render=rss&num=50&url=http%3A%2F%2FYOUR-URL-HERE

However, using Blogger's Feed Widget will limit the number of items you can display to 5 instead of 10, and you will not be able to number your items.

Troubleshooting the Popular Posts Widget

If you have installed this widget in your blog but the post links are not displayed, this may be due to one of the following issues:


You have added your blog's URL incorrectly

Double check your blog's URL when you add this to the widget installer, and remember not to add the "http://" part as this is already added by the script.

Your Comment Feed is Set to None

To remedy this, go to Settings>Site Feed in your Blogger dashboard and click on the "Advanced Settings link. Here you will see the option to switch your comments feed to Full or Short instead of None.

I have tested this widget extensively for both Blog*Spot and custom domain URLs in Internet Explorer and Firefox. So far, I haven't come across any problems, though if you do have a problem with this widget which I've not covered here, please do leave a comment or get in touch and I will try to help.

If you have found this widget to be a useful addition to your Blogger blog, please consider subscribing to the Blogger Buster feed and be updated of new articles about Blogger as they are posted.


No comments:

Post a Comment