Combining and Filtering Feeds Using Yahoo Pipes
I had some fun with Yahoo Pipes yesterday. At CScout, we use a rather clunky email newsletter service called FeedBlitz. (I’m not even going to give them link love because they’re really quite bad.) The one good thing this service does is allows us to create newsletters from an RSS feed. The service has worked adequately to allow us to publish titles, clippings and links to posts on cscout.com, but in talking to the CScout Japan guys, Florian decided he’d like to incorporate their posts into the newsletter as well.
First things first, I found a Yahoo Pipe that combined two XML feeds into one. This worked as expected but wasn’t perfect for our needs. The main problem was that FeedBlitz was set to grab the first 150 characters of individual posts. The actual problem was that in many cases there was an image that led into the post. Not only that, but image placement wasn’t consistent, which led to a pretty disorganized looking newsletter. My solution to this was to use the Regex module in Yahoo Pipes and strip out images. Looking at the raw XML from the feeds, I found the elements that contained images and simply repaced “<a.*?><img.*?></a>” or “<img.*?>” with nothing. These commands in this module found instances of images, or images that linked to something, and wiped them out. The next test newsletter showed a much more attractive result. But it still wasn’t perfect.
What we found then was that not all items in the newsletter were displaying the contents of the feed’s “description” element. We decided we wanted just the description to be shown, omitting the post’s typical clipping. What I did here was a bit of a hack. I used the Rename module to change the “content:encoded” element’s name to “blank.” Any name would have worked here; blank was sufficiently descriptive in this case. I then renamed the “description” element to “content:encoded” as it was content:encoded that was always displayed. At that point it was just the posts’ descriptions that were being displayed.
I’m not going to publish this pipe as it’s really only useful to CScout, but you can see how it is setup in this image:

The end result is the CScout Trendletter you see below:








