Wednesday, September 22, 2010

Hacking labels and categories into feeds

In a previous installment we looked at how to help readers find only the articles written by one particular author in a Blogger multi-author blog. Here we look at more hacks employing labels and feeds.

feed-hackGoogle labels, even though one-dimensional, are a very powerful feature that can help you make the best of either Gmail or Blogger. Google Mail hacks are discussed elsewhere, here we’ll focus only on Blogger.

Most major blogging platforms include ways of obtaining feeds for specific categories. This is a little known feature, as most publishers are not interested in segmenting their content in such a manner, particularly since subscriptions to specific categories only could be difficult to track and may cause an increased burden on their server.

With Wordpress, you can use

<?php get_category_feed_link( $cat_id, $feed ); ?>

where $feed can be either ‘rss2’ or ‘atom’ and is optional. In practice, this results in the following URL:, or, if custom permalinks are used, Such a feed will come up with the name of the blog, but most blog readers will allow you to customize it easily.

With Blogger, we have category feeds as http://<subdomain><label1>/. If there’s a custom domain, we obviously have<label1>/. Let’s summarize the special feed format for both platforms:

FEED Blogger Wordpress
Site http://<subdomain>[rss|rss2|rdf|atom] or[rss|rss2|rdf|atom] if permalinks
Comments http://<subdomain> (permalinks) (default)
Article C. http://<subdomain><PostID>/comments/default
Category http://<subdomain><label1>/
( if custom permalinks)
Authors ?

For all Blogger feeds the default is Atom 1.0; to obtain RSS 2.0 feeds, simply replace “default” with default?alt=rss. You can find the postId of an individual post from the Posting | Edit Posts tab. Simply mouseover the 'Edit' link next to a particular post, and that postId will be displayed in your browser's status bar.

Wordpress offers more flexibility in terms of building logical constructs into the feed:

  • (search)
  • (exclusion)

Blogger allows only concatenating labels (categories):


Negations (exclude a label) and disjunctions (or) are not supported yet:


Most of these hacks are only indirectly useful to the publisher, as less control can be exercised over such runaway feeds. What a Blogger publisher could do, however, is provide the feedburned version of the following:

                        <b:if cond='data:post.dateHeader'>
                        on <data:post.dateHeader/>
                        <b:if cond='data:post.labels'>
                       . You can find similar articles under the following categories:
                        <b:loop values='data:post.labels' var='label'>
                        <a expr:href='data:label.url' rel='tag'><></a> (<a expr:href='data:blog.homepageUrl + &quot;feeds/posts/default/-/&quot; +' expr:title='&quot;RSS feed for &quot; +'><img alt='Subscribe' src='' style='vertical-align:middle;border:0'/></a>)<b:if cond='data:label.isLast != &quot;true&quot;'>,</b:if>

The above is a rather clever hack, but most readers would not quite understand what it means. Here’s what it looks like on a foreign-language blog using the Aspire template:

Blogger Category Feed Hack

To control the feeds and obtain stats, one would have to burn each category feed with feedburner in a format such as<MainBlogFeedName>/<label>. It is then possible to change the format of the feed in the “label loop” so that the actual feed is provided by feedburner.

Whichever hacks you choose to use, though they may seem more useful to a reader, the publisher will derive a benefit from improved customer satisfaction.

LE: Interesting discussion on CamenDesign on what RSS is and what it could be.

Sources / More info: Google Data Protocol Reference, Blogger Support Feeds, wp-codex-feed-link, wp-feeds, yt-feeds

No comments:

Post a Comment

Thank you for commenting and rest assured that any and all comments are welcome, whether positive or negative, constructive or distructive. Unfortunately, if you comment in this view I might not know about - please use the regular (Desktop) view.
I am using Disqus for commenting, but Blogger is not showing it so your comments may end up not being displayed - tell Google about it!