New filtered After Dark feed

Once upon a time, 5by5 didn’t offer combined feeds that allow you to subscribe to both a regular show, like Back to Work, and its After Dark coda. There were simply feeds for the shows proper, and a single After Dark feed that gave you the ADs of all the shows. So even if you had no interest in certain shows—The Critical Path, for example—you’d get their After Dark episodes anyway and have to delete them manually from your podcast player to avoid disruption. Back in those benighted times, I wrote an XSLT filter that deleted from the amalgamated AD feed all the shows I wasn’t interested in.

Now, of course, we live in a bright and shiny future. Within a couple of weeks of my XSLT exercise, Dan Benjamin started offering the combined feeds, a no-fuss, no-muss way for regular folks to get only the ADs they want. I suspect Dan’s change was motivated by the same thing that inspired me to write the filter—these two tweets from Jason Snell:

The “Smart Playlists” feature in Instacast 2 isn’t smart. I’d like only @5by5 After Darks from certain podcasts, but it can’t filter that.
  — Jason Snell (@jsnell) Mon May 14 2012 8:11 PM CDT
(Solution: I made a Yahoo Pipe that takes in the After Dark feed, filters by show title, and then outputs a new RSS feed.)
  — Jason Snell (@jsnell) Mon May 14 2012 8:26 PM CDT

You’d think the new combined feeds would make my filter obsolete, but unfortunately Downcast’s search tool never seems to find them.

Downcast search for Hypercritical

Now, I know I can enter the combined feed addresses manually, but that means typing in a half-dozen or so URLs, and I’m too lazy for that. So I’ve stuck with my old solution: a single feed URL that leads to my filtered version of the full AD feed. I did have to enter this address manually, but there was only one of them.

With the recent FeedBurner unpleasantness, Dan’s pulled all the feeds from and started hosting them himself, which has caused a few problems.

If you use Downcast, you’ll need to resubscribe to the feeds. Sorry to sound like a broken record but people keep asking.
  — Dan Benjamin (@danbenjamin) Wed Oct 10 2012 8:45 PM CDT

One of the problems was that the new AD URL broke my filtered feed. I was subscribed to a URL on my server that ran this CGI script:

echo "Content-type: text/xml"
xsltproc afterdark.xslt | sed '/^ *$/d'

That FeedBurner URL now returns this XML,

<?xml version="1.0" encoding="UTF-8"?>
 <rss version="2.0">
<channel><title>(Obsolete Feed)</title><link></link>
<description>Old feed that has moved to</description><item><title>Feed has moved</title><description>

which is nice, in that it provides the new link, but unfortunately xsltproc just sees an XML file and tries to process it—it doesn’t treat it as a redirect.

The solution, though, was simple: just give the CGI script the new feed URL,

echo "Content-type: text/xml"
xsltproc afterdark.xslt | sed '/^ *$/d'

and everything is back to normal. No need to change the XSLT file itself.

Just for completeness, here’s the XSLT filter:

 1:  <?xml version="1.0" encoding="utf-8" ?>
 2:  <xsl:stylesheet version="1.0" xmlns:xsl="">
 4:  <xsl:output method="xml" encoding="utf-8" indent="yes"/>
 6:  <!-- First, get everything. -->
 7:  <xsl:template match="node() | @*">
 8:     <xsl:copy>
 9:         <xsl:apply-templates select="node() | @*"/>
10:     </xsl:copy>
11:  </xsl:template>
13:  <!-- Then restrict to just certain items. -->
14:  <xsl:template match="/rss/channel/item">
15:     <xsl:if test="title[contains(., 'Incomparable') or contains(., 'Build and Analyze') or contains(., 'Back to Work') or contains(., 'Hypercritical') or contains(., 'Ihnatko') or contains(., 'Mac Power Users')]">
16:       <item>
17:         <xsl:apply-templates select="node()" />
18:      </item>
19:    </xsl:if>
20:  </xsl:template>
22:  </xsl:stylesheet>

If you’re interested in how it works, see that earlier post.

6 Responses to “New filtered After Dark feed”

  1. WMP says:

    Assuming you have an I ios device, I think you missed the easy way.

    I just clicked the combined show & After Dark link on the 5by5 site and the link was added to Downcast automatically. I’m not quite sure why it worked, particularly how it knew Downcast was my preferred podcast app, but it did.

  2. Dr. Drang says:

    Not only did I miss it, WMP, but before your comment I wouldn’t have even thought it possible. But as I think about it, it does make sense. You can open PDFs in GoodReader, for example, because GoodReader has registered itself as a PDF app.

    I’ve done a little experimenting and found that this method of subscribing doesn’t work with Instacast but does with iCatcher! and, as you might have guessed, with Apple’s own Podcasts app. If you have more than one app that are registered to handle podcasts, the system appears to choose the one that comes first in alphabetical order. And if you have no podcast apps, tapping a feed link leads to this response:

    Subscription failure

    I got this message when I had deleted all the podcast apps from my iPhone except Instacast and clicked on a podcast feed link. Given that the error message says I don’t have an app that can display RSS feeds, this suggests that the system is treating podcasts like any other RSS feed. If that’s the case, it means that Reeder, which was still on my phone when I clicked the link, isn’t registered to handle RSS feeds. Weird.

  3. Rob Mathers says:

    The alternate “easier” method to add feeds from Safari (to Downcast at least), if for whatever reason the URL handler doesn’t register:

    Tap-and-hold to copy the feed link from the 5by5 site. Open Downcast, tap Add Podcast, Add Manually and it auto-fills the URL on the clipboard. Tap subscribe and you’re done. No manual typing (or even pasting).

  4. Dr. Drang says:

    Oh, Rob (pardon my Laura Petrie), I’m glad you put “easier” in quotes. The back-and-forthing needed to transfer several feed URLs via copy and paste is something only Torquemada could love. I’d probably paste the first part of the URL, which is the same for all, and type in the last word. Like an animal.

  5. Rob Mathers says:

    Yes, I suppose that method gets old for number of feeds > 2. A Downcast (or Instacast or what have you) Mac client would be a nice thing to have, if only for managing subscriptions better (although syncing positions for listening on my Mac would be nice too).

  6. Phaedra Deepsky says:

    You could alternatively run your feeds through yahoo pipes.