Question

The Loop operator in Yahoo pipes has two choices for its output: Emit (first/all) results, and Assign (first/all) results to _.

What I really need is a Loop that will Assign the first TWO results to an element. Is there any way to accomplish this?

Background: I've got a CSV file, where column 1 is the feed URL and column 2 is an internal feed id. I start with "Fetch CSV", and connect that to "Loop" inside which I "Fetch Feed" and Assign All Results to item.feed. That outputs close to what I need, but since some of the feeds in my list are huge and I only display the first two elements of each feed, I want to eliminate the unused data in my output JSON file.

Sounds like it should be easy, right? But I can't seem to get it right.

Was it helpful?

Solution

OK, I finally figured this out. Created a new Pipe called Truncate2 which pipes "Fetch Feed" into "Truncate" and outputs the result. I wired "URL Input" into Fetch Feed as the url source, and then from the original Pipe, I pulled Truncate2 inside the Loop and Assigned all results.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top