It's the Time of Year for Filters

This time of year is filled with jubilant hipsters and 40 year old cool-guys tweeting about their favorite conferences.1 I really appreciate the mute filters in Tweetbot 2 but wish that I had the same in my RSS feed reader.

Sam Mellor on Twitter mentioned he had that problem taken care of. Sure enough, he has a clever little Python script called RSS-filter.py that scans Google feeds for a specified regular expression and marks those articles as read.

So it’s as easy as setting up a basic config file:

And running the command3:

It has a few dependencies that need to be installed. One that I never thought about is the libgreader library for Google Reader. It’s a nice little library for interacting with your feeds.

Setting up RSS-filter.py is pretty easy but not mindless. First, there are several dependencies that I needed to install. No big deal. Second, I needed a Google OAuth token and secret, which required me to register a new application with Google. It’s easy but not something I had done before. I created new application keys and secrets just for this purpose.

The script does a pretty good job of walking through the setup. It asks for all the Google OAuth keys and secrets and then stores them in a settings file in ~/Library/Application Support/RSS-filter/.

There are a couple of shortcomings to the script. For example, each feed must be configured with its own set of regular expression exclusions. Additionally, the script only looks at the article title and not the content of the article. So RSS-Filter.py is more of an initial filter for stupid.

EDIT: Sam already updated the script to work with a global filter. This is pretty nice.

For more complete filtering, I’ve used Reeder on the Mac.4 I select all feeds and search for the offending term. It’s then just a single click to mark them all as read. The benefit here is that Reeder searches through the content as well as the title.


  1. Really, I don’t begrudge anyone their excitement. I just don’t want to read about it everywhere I look. I get it. SXSW is “amaze-balls” and you totally did the best shooters ever. Ok, now I’m just being mean. I do like the stuff the film guys share after the Burning Man SXSW show. ↩︎

  2. Just like Dr. Drang ↩︎

  3. I haven’t decided if I want to set this up as a cron job yet. ↩︎

  4. This also works with several other feed readers, including several on iOS. Credit to Jason Clarke for suggesting Mr. Reader. ↩︎