September 25, 2006

Displaying recent comments in sidebar

UPDATE: I came up with a customizable version of Recent comments widget later. Please try it instead of this.

The much-awaited comments feed is completely functional now! I saw Hoctro's post on this topic and found my blog's comments feed also working great. Blogger team seems to have fixed the stale comments issue on Friday. It's very easy to show recent comments in sidebar now (as I have done in my widebar - the wide sidebar). Just goto Page Elements tab, add a page element of type Feed to sidebar and give the following as the Feed URL.
http://yourblogname.blogspot.com/feeds/comments/default. You could select to show the date and comment author if you want.

Notice that they have changed the feed URL not to contain any blog ID etc. This makes it easy to play with any blog's post and comment feed URL programmatically.

UPDATE: Many readers asked me why comments are not immediately shown after published. It is because it takes some time for the new comments to be added to the comment feed. Just wait for some time and it will show up. Yes, this is a limitation of using feed to show recent comments.

60 comments:

Ian Pye said...

Hi Ramani - one thing I'd like to do is have more than 5 comments in my recent comments feed displayed in my sidebar. Do you know how this can be done?

Unknown said...

will this work in non beta? how?

Unknown said...

Living in canberra, Blogger allows only upto 5 items from the feed. But you could some other service like rss-to-javascript.com if you like more flexibility.

chllout_lev, no, this approach won't work in non-beta blogs because Blogger doesn't provide comment feed for them. But there are some hacks to do this like this one.

http://www.editthis.info/bloggerhacks/Farrago_Recent_Comments_Hack

Anonymous said...

Yes, it's works in Beta.
But not in a private blog.

It isn't the solotion.

And Farrago's don't works in Beta.

Luis

Unknown said...

Luis, I don't understand why comment feed doesn't work in private blogs. You could report to Blogger support.

point 23 said...

I'd like to keep the header for this feature the same size, but make the actual text a size or two smaller.

Is there any way I can do that?

Unknown said...

point23,

we cannot tweak the feed element much. you will have to change the CSS if you want to do all that.

Gary said...

This is or should I say "should be" a VERY simple operation BUT, it telling me I am inputting an url that is not valid. This should work as a feed url...

http://lincolncountykentucky.blogspot.com/feeds/comments/full

But it's tellin me it's bad. Could it be because I use HaloScan?

Unknown said...

Gary, haloscan comments will not work with this. This is only for Blogger comments.

Gary said...

You know that makes too much sense, I should have known. Using HaloScan take's blogspot's comments out of play.

Oh well, I'm learning a lot from you guys.

Lory said...

I have applied this to my site. Very kewl!

Deepa said...

Hi..
I would like to know if it would be possible to retrive the names of those who have commented to the blog and dispaly their names in the main-page sidebar.
So as to say.. if a person is commenting (on a certain post) for the first time then as soon as his comment is posted-his name appears on the "guestlist"
IF the person is a repeated visitor then the name is dispalyed only once
That way one can keep track of those who have commented
I dont know if this is possible..just an enquiry (suggestion)
Thank you

Matthieu said...

Hi,

I don't understand how to use it, I don't have a "page element tab" on Blogger. The only way I know to change the template is to change the html directly. That way, how can I display the comment RSS feed ?

Thx for your help

Anonymous said...

Hi! I just added your information for the comments. The newest comments are not showing up. Did I do something wrong?

Unknown said...

matthieu, did you switch to Blogger Beta? If so, you should be having the Page elements tab under the Template tab.

debra, new comments will take some time to show up because the feed gets updated a bit late.

Bryce Perica said...

Helpful site. Thanks Ramani.

Marcelo said...

Hi Ramani,

I don't know why I keep receiving the message "Invalid Feed URL" at the box element. I tryed the adress and it works, it is:
http://pruebas-marcelo.blogspot.com/feeds/comments/full

Do you have any idea what it could be?

Unknown said...

Marcelo, I don't see why it's giving you that error. check with Blogger support.

Leo Piccioli said...

It worked until last monday, today (sat 14th) it keeps giving errors. Can the service be down?

Anonymous said...

people commented in my blog but they doesn't show on my recent comments. i have already inserted the feed in my beta layout. what's the prob?

Unknown said...

gar, please read the update that I added to this post for an explanation.

Ameet said...

don't know why I keep receiving the message "Invalid Feed URL"

Sue said...

Your update doesn't cover all problems. I have waited three weeks for my comments to 'update' and they have not. I have left them, but they look silly.

Unknown said...

Honeycakes, I can't control the feed. Your feed seems to have some problem. Report to Blogger.

Ameet, yours too.

Priya said...

Thank you ramani, it works fine for me.

Priya said...

Ramani,

The comment section is fine but its not picking up the new comments whenever I receive a new comment.

Unknown said...

Yes, Priya. Read the Update in this post. It will take some time to be added to the feed.

Anonymous said...

Try this Marcelo.

http://pruebas-marcelo.blogspot.com/feeds/comments/default

Unknown said...

Thanks Anon! That did the trick. I was getting the "invalid feed" message but then used http://yourname.blogspot.com/feeds/comments/ which solved it! Thanks for that. Not sure why "full" wasn't working ...

Unknown said...

Juan, i'm glad to see useful interaction happening in my comments section.

Jeff Day said...

If you're having trouble with the built in comments feed on Blogger Beta (whether it is a speed issue or something else), there are about 100 blogs now using the Blogger Recent Comments module from Storago, and it works painlessly to get them in the sidebar AND an atom feed. Hope this helps.

Anonymous said...

Hi Ramani! Thank You for Your hint about using Blogger beta self feed.
Would it be possible just to change the order of the comments fields? like for example: author, post title, date, comment text?

Unknown said...

it works. I tried in on my page already: yessssssss....its beautiful updated

http://niezom.blogspot.com/feeds/comments/default

Unknown said...

hey man i was actually interested in such a thing to display comments.. and i went thru some blog and saw haloscan and some other site links.. but thanks for actually givin a blogger hack .. beats going thru another provider .. this is awesome .. ive just set it up in my blog ..have a peek http://netskool.blogspot.com

eiklin said...

hi,

your "Recent Comments" is much neater than the one that comes default, are you using some special javascript to parse it?

with the feed provided by blogspot, i also noticed that there seems to be a programatic error such that "comment-" will always be left out in the url to the comments. any idea?

Unknown said...

Eiklin,

I have announced newer version of recent comments (that I am using) in this post.

http://hackosphere.blogspot.com/2006/11/hans-customizes-recent-comments-further.html

It has the comment URL fixed as well.

eiklin said...

thanx Ramani.

i had made customisation myself -http://eiklin.blogspot.com

1. the actual javascript is embedded in a new javascript page element. i thought this is a good way so that we need not link to external url (which you have also mentioned) and also the javascript will not be lost whenever we change theme. this works quite well as the javascript page element is "hidden" since there is no actual text to display on the blog.

2. i have changed the url to be on the comments summary rather than the name of the person making the comment; i guess this made more sense. also, too bad we cannot retrieve the profile of the person making the comment from the comment feed, else one could have created a link for that as well.

cheers!

Anonymous said...

Now, more that two months after this post, I have tried several versions for Recent Comments and I like this one best. It places the dates properly in other languages, the comments are too close to each other but we can add a line break, the others put the titles in lower case. We can do almost everything as with the others and without pub. It has a drawback, however, it does not show the titles. Ramani always has the best ideas and finds the best solutions.

hy said...

I want to allow readers to post comments directly on the sidebar. Can I do that?

Unknown said...

What you are asking is similar to inline comment form in post pages. I won't encourage it because it is not safe. Blogger's comment posting page uses secure HTTP whereas your post page does not. If the Google username/password(that you give while posting a comment) are stolen, somebody might access your email etc. This is why Blogger folks have wisely used secure HTTP in Beta.

hy said...

Thanks ramani!

But is there a way I can put a link to a separate inline comment form on the sidebar, so people can comment on the entire site in general, or as a way to send me messages.

Sort of like having just one post on the side bar with a comment link below it.
Is it possible?

Thanks! I love your site and looooveee your expandable buttons, it's like magic.

Unknown said...

hy, even then you are going to use Blogger's commenting system, right? If you ask the reader to provide his Google credentials in your sidebar, it is not secure. If you allow anonymous comments, it is probably ok.

hy said...

oh ic! I'll forget it then. Thanks!

My Stereo Magnet Girl said...

My comments using the widget rss will not work - why is that?

Webmaster Bellas Venezolanas said...

Hi. I would like to know how I can change the Header of my Beta Blogger site, and how to put the most commented post on my side bar...

Thanks... Great blog that you have here...

bellasvenezolanas@yahoo.com

G said...

This is soooo great:) Thanks!!!:)

humblepie said...

Pasted the URL feed into the sidebar element. Uploaded comments great. Now, days later after more comments have been left, the sidebar shows the older comments. What gives?

Unknown said...

Humblepie,

There's a bug in Blogger that have been introduced recently which causes old comments to be shown. I hope they will fix them quickly (they know about it).

humblepie said...

I hope so, too. Thanks for the info!

Lovely said...

Hii Ramani,
I applied your hack on my blog(http://visitformoney.blogspot.com), plz check how it is ?

Thanks
Eliena Andrews
http://visitformoney.blogspot.com

uttarayani said...

I keep learning from your advice, but somehow I missed the following if you ever gave that:

How to list comments in reverse chronological order, ie the most recent one on top?

Manoj

Unknown said...

Manoj, I implemented that feature as part of Neo template. I am not offering the template right now.

Jedi Dadi said...

Ramani,
How did you customize your recent comments to say "On April 14, Ramani said".....?
I'd like to add the date to my recent comments.
thanks,

Unknown said...

Steve, Beautiful Beta's version of recent comments has the date. you can try it.

pugmama said...

so easy... thanks!

Steel Rat said...

This isn't directly related, but how did you get a Feedburner feed for all your blogspot comments? Searching on feedburner forums, they don't seem to offer that.

Unknown said...

Replicant,

Just provide the following feed URL to feedburner and create one.

http://yourblog.blogspot.com/feeds/comments/default

You have to replace "yourblog" with your blog's address.

gemma said...

hi ramani!

what about for old blogger templates? all i have is a recent comments list that only displays the author and the date/time. i want one that includes the blog item title as well.

please help! thanks!

Unknown said...

sushi, I am not planning to create any more new hacks.

Anonymous said...

Hi Ramani,
I would like to know how to reverse the comment list in order the latest comment appeared first of ended post and the oldest one at the bottom ?.

I mean that like this blog, the latest comments becoming first and the other comment posts sort by the date of the comments in decreasing order...

Can You explain how i can do that? Pls help.. and thanks..