Blogger Beta has been about for a bit now, and one of the new features it talks about is not only post feeds, but comment feeds and label feeds. Now, if you've used the FTP publishing features of Blogger, these don't seem to get published to your site. So how do you access them?

As usual Tony helped to point me in the right direction. However, first some housekeeping. I've not checked you have to do this, but I think its probably best you tell Blogger to publish these feeds as step number 1. In Blogger, under Settings > Site Feed > set all of the feeds to “Full”. Secondly you'll need to know your blog ID. You can find this in a couple of places, the easiest place is on your own blog. On the “Post a Comment” link, look at where the link is going. In there it will say something like blogid=10446442, that number is your blog ID.

Right then, basically every feed for your site is hosted on the beta.blogger.com domain for anyone to access (the post feed is still published to your FTP site as well). So for example listed below is the post feed and comment feed for this blog, and the label feed for Tony's blog (because I haven't started using labels yet). They take the basic form http://beta.blogger.com/feeds/[blog ID]/[feed type]/default

All of these are currently in the default Atom format, but you can specify to get this out as rss by sticking alt=rss on the end of the url, like so:

Now the really exciting stuff with all of this happened the other day, Blogger announced you can get hold of these feeds as JSON, again by simply sticking alt=json-in-script on the end of the feed url, like so:

So now we know how to get hold of all of the available feeds for our blog, in the format of our choice, what can we do with them? Well, pretty much what you like, but something I've been wanting to do on my site is to display recent comments, so using the JSON formatted comment feed I've added a section on the right nav called “Recent Comments”, and the code that does this is below.

<h2>Recent Comments</h2>
<ul id="recentComments"></ul>
<script type="text/javascript">
function loadRecentComments(obj) {
for (i=0; i<obj.feed.entry.length&&i<5;i++)
{
var sStr = obj.feed.entry[i].author[0].name.$t + " said \"" + obj.feed.entry[i].title.$t + "\""
document.getElementById("recentComments").innerHTML += "<li><a href=\"" +
obj.feed.entry[i].link[0].href + "\">" + sStr.substr(0,40) + "</a></li>";
}
}
</script>
<script type="text/javascript" src="http://beta.blogger.com/feeds/10446442/comments/default?alt=json-in-script&callback=loadRecentComments"></script>


Hopefully that's helped you out, but please be aware that I don't think Blogger have publicly announced these feeds, so they may be subject to change. That said, enjoy!