Thursday, August 22, 2024

A feed of overlaps

In brief

  • Use the AND operator + in the feed url to filter the intersection of two search terms.
  • Follow the feed in a reader or use it to create a dynamic list.
Image: Kismalac (public domain)
A AND B

Obscure, yet super useful, blog feeds let readers view your blog in a reader, and let you add functionality to your blog such as email subscriptions or automated lists.

This post explains how to tailor a feed so that it lists only posts that share two or more search terms.

Start with the introduction to this series for more about feeds generally and tailored ones in particular.

Both A AND B

The form of all the compound feeds is the basic blog feed plus a search query plus search terms. For example,

https://too-clever-by-half.blogspot.com/feeds/posts/default?by-date=true&q=label:feeds+label:"things that changed"

That is the feed for all my "feeds" posts that are also labeled "things that changed." It corresponds to the AND label search for blog pages I described last year.

In the above url for the feed,

  • too-clever-by-half.blogspot.com is the blog url.
  • ?by-date=true is an operator to specify most-recent-first.
  • &q= is the search query operator.
  • label:feeds is the label to search for.
  • + is the logical (Boolean) operator AND for the intersection of the two sets of posts.
  • label:"things that changed" is the second label. Note that quotes are required for label names that include spaces.

You can also search by phrase and word. Just omit "label:." &q=feeds will find all posts that include the word "feeds," labels or not.

This and other compound feeds pass the Word Wide Web Consortium's feed validator. Nonetheless, they fail with some feed readers.

The feeds are recognized by RSS 2 HTML, the service I currently use to create dynamic lists of posts.

Here's what my example feed ("feeds" AND "things things that changed") looks like as such a list:

That is every post on this blog about changes (to Blogger, in case that is not clear) that is also about feeds.

The intersection of those two topics is quite small. But if it changes, the change will be reflected in the above list.

Related posts below.

Tailored feedsLogical OR • Logical NOT
About feeds • Dynamic listsTailored pages

No comments:

Post a Comment