July 23, 2009

How to Get Feeds For Specific Labels in Blogger

Blogger generates feeds for various items on your blog including posts and comments. Not many people know that these feeds can accept certain filters. The labels filter is one of them.

You might want to publish feeds for specific labels for various purposes. As an example, Aspin.com allows coders to submit RSS file of asp related resources into their database. You can label ASP specific posts from your blog as "asp" and publish its feed. You can label php related posts as "php" and publish its RSS to another resource. You may also want to publish specific feeds for targeted audience. Labels are the suitable method to group your posts by topic. These topics can then have their individual feeds. Your visitors can subscribe to feeds of their choice. All you have to do is to publish appropriate feed URLs on a suitable location.

Here is how you can get post feeds for specific labels.

The Basics

To begin with, site feeds must be enabled in your Blogger powered blog. The posts feed URL of a Blogger blog (such as this one) looks something like this:

http://salman-w.blogspot.com/feeds/posts/default

Append /-/<labelname> at the end of this URL; thats it!

http://salman-w.blogspot.com/feeds/posts/default/-/php

Tips and Tricks

If your label contains special characters, you must URL-encode them properly. For example, the label might contain spaces. The spaces should be encoded as %20:

http://salman-w.blogspot.com/feeds/posts/default/-/image%20manipulation

If you want to filter posts by multiple labels, simply specify the list of labels separated by slash. The following feed will contain posts that contain labels "php" and "asp":

http://salman-w.blogspot.com/feeds/posts/default/-/php/asp

It is also possible to specify more than two labels. The following feed will contain posts that contain labels "php" and "image manipulation" and "gd library":

http://salman-w.blogspot.com/feeds/posts/default/-/php/image%20manipulation/gd%20library