One of the most common uses of Yahoo Pipes is to mashup several RSS feeds and perform a few operations on them, such as sorting by date or filtering for keywords. This is a relatively easy Pipe to build, and you have many options for filtering and/or sorting, depending on your needs. Before you continue reading this tutorial, please read up on basic Yahoo Pipes functionality.
Sample Yahoo Pipe Details
In the sample Pipe for this tutorial, we’ll mash together the RSS feeds of two blogs, Performancing and Blog Herald, sort reverse chronologically by date, then truncate the resulting RSS “stream” at 20 items.
Basic Yahoo Pipe Building Process
Let’s go over a basic “feed mashup” example, then discuss variations. The most basic feed mashup is to simply supply two or more RSS feed URLs in a Yahoo Pipe. (For simplicity, let’s start with a static list of feeds.) But that’s not useful since you don’t know how items in the resulting “stream” are ordered. So let’s sort the mashed up feed in reverse chronological order (newest to oldest). The process is as follows:
- Supply two or more RSS feed URLs.
- Fetch the feeds.
- Combine the feeds together.
- Sort them in reverse chronological order.
- Truncate the mashed feed to 20 items.
- Output the resulting stream as an RSS feed
Yahoo Pipes Modules to Use
That is the most basic process, and to produce an actual Yahoo Pipe, we need to use only 4 modules, in the following order:
- Fetch Feed. Specify one or more feeds, grab their items, and combine them into a single feed.
- This Pipes module is found under the Sources sub-menu.
- Assume resulting item ordering is undefined.
- In our example, shown below, we’ll use the Performancing and Blog Herald RSS feeds.
- Sort. Specify a sorting field and criteria. In this case, sort by Publication Date (item.pubDate) in descending order.
- This module is found under the Operators sub-menu.
- In the past, Pipes’ Sort module has not always worked consistently, but we are at its mercy.
- Truncate. Take the mashed stream and truncate it after X items.
- This module is found under the Operators sub-menu.
- We’re limiting the result to 20 items.
- Output. Output the mashed stream. This will be available from the standard Yahoo Pipes “run” interface. From there, you can retrieve the dynamic RSS feed URL for the output stream.
- This module is automatically displayed in a new Pipe, once you drag and drop any other module.
A screenshot of a sample Pipe is displayed below. Provided that you have a Yahoo Mail account, you can access the sample Pipe, clone a copy into your account, and tweak to your heart’s content.
Basic Pipe Variations
There are a number of simple variations that you can apply to the above sample Pipe that are relatively easy to do.
- Sort in chronological order (oldest article first).
- Filter by date. E.g., articles newer than a certain day.
- User-supplied date filter. Pick the maximum
- User-supplied truncation limit. So instead of hard-coding “20” as the number of items in the mashed feed, let the end user of the Pipe supply the value.
- User-supplied URLs. You are limited to a fixed number of URLs that can be specified.
Advanced Pipe Variations
Here are some more advanced variations for our feed mashup Pipe.
- Remove extraneous data fields in input streams. If you look at the results of the example Pipe, you’ll see more than just the item description and title. One of the input feeds has extra links thanks to its Feedburner settings. If you don’t want them appearing in the result, you have to filter these fields out before the two feeds are mashed together.
- Truncate the number of items used on a per feed basis rather than on the entire mashed feed. E.g., the 5 most recent items for each feed.
- Use a dynamic external list of feed URLs. The best way to do this is to build Pipe #1 to process a single feed: sort reverse chronologically and truncate to X items (hard-coded or user-supplied). Then build Pipe #2 to read an external list of feed URLs and loop through each, supplying each stream to Pipe #1, then mashing up the results of all streams.
Requests for Custom Pipe
Obviously, I cannot provide example Pipes for each variation listed above, but what I will do is two things:
- Take suggestions for an advanced Pipe as described above, create it, then either share it in the comments here or cover it in the next Yahoo Pipes By Example post. So I’ll build a free custom Pipe, provided it’s not too complex, can be done in a few hours, and is generic enough that it’ll be useful to someone other than yourself. (I can only work on it on weekends.)
- Progressively include other Pipes modules in hard exampes.
So if there’s a Pipe you need and something like it is described in the Advanced section above, feel free to ask. Be specific about the details. I’ll be doing the next Yahoo Pipes By Example post next weekend (one per week).
Just found this great blog after pulling my hair out all day.
I’m trying to add Pipes output to other content on pages and am trying to understand the best way to include it on the page for SEO purposes.
Hmm. Interesting. Well that’s good news then, but the Babelfish module is listed in their “Deprecated” menu. Not sure why it’s still accessible in new Pipes.
Strange Raj, because I used it on a new pipe at the weekend. I did notice the translation module, but not played around that one, I chose Babelfish as I am familiar with it.
Ryan: Very easy. I’ll do that and share it here. (Both version)
Darren: Babelfish module has unfortunately been “deprecated”. You can continue to use it in older Pipes but you cannot access for new Pipes. They have a replacement, but I haven’t studied it enough.
Ryan, you can do that easily yourself, it’s a piece of pish to do.
Within Pipes there’s a module for ‘babel fish’ where I managed to translate my RSS feed into Spanish. I can offer this out as a non-English RSS feed, which I think is great, but I am going to struggle to communicate with those that want to leave comments in Spanish.
What I’d like is that the reader can write comments in Spanish and then translates the comments into English. This will make your blog multi-national and target those millions who speak Spain and other languages.
Anyone else think this is a good idea?
Another thought about pipes, and at this moment I am not sure if this would be possible, but I’d like to be able to add in advertising into my RSS feed much easier than I can now. So if I did have a Spanish version of my site, I could easily add in advertising which suited the Spanish readers.
No, I don’t need “top blogs” – I just want one of the following 2 things:
1. The last 10 articles posted, in temporal order, from the set of all feeds in list X
2. Max of one story per feed, temporally ordered, most recent stories from the set of all feeds in list X
Option 2 is more difficult because it puts a limit of 1 on the total number of stories that can be extracted from any given feed.
Ryan: It’s quite incredible what you can produce, powered by Pipes.
I think I know what you wanted to do. In the spirit of this series, I will do it here for free, in the next post. But how did you want the feeds filtered/ manipulated? I.e., how many items per feed, any special treatment per feed, etc.?
I’ve already built a Pipe that takes the URL of a web page, yanks out all the href links, then produces the list of corresponding feeds per link. That’s one way of producing the external list. Another way is to supply an RSS URL list in .CSV form (single data field per row), read it into the Pipe, truncate each feed to the X most recent items, then mash them all together. So if the external list has 10 feeds, we sort each feed reverse chron, truncate to, say, 5 items, and output 10×5 = 50 items maximum.
If you need for this Pipe to pick out the top blogs in a niche, that’s more complex, and I hope to do that a few weeks down the line – depending on the state of Technorati’s API.
Raj, I think you already know my need, re: a dynamic external list of feed URLs. I’d pay you to create the tool I’ve referenced in the past.
Wow Raj. This is truly the first time I’ve actually gotten my mind around the power of Pipes. Thanks man!
Darren: That’s great to know. Thanks for sharing. I never thought it through, so I wasn’t sure if Google Maps could be integrated. (I have a dormant travel blog and a city blog-in-waiting.) Also agree with you: if I start working on a Pipe, I often find I spend many hours playing with variations or checking out other people’s Pipes.
Yep, I’ve not got a great deal done this weekend because of Yahoo Pipes – thanks! 😐
I used pipes using the ‘union’ operator to combine results from Yahoo local for ‘hotels’ and ‘restaurants’ within 5 miles of New York. With this data I was able to export a KML file which I uploaded to my server, and then went to Google map, entered the URL, and use the street view functionality along with the Yahoo local results.
This is the result.
I’ve had a great idea how I can implement pipes into my travel blog..
Garri: I’m just getting started
Thanks for this Raj! Although I dabbled with Pipes to create Travel in Papers, it was a while ago, but this is an excellent reference article for me to come back to. Kudos for your generosity mate 😉