Using Yahoo Pipes, how can I do the equivalent of "Loop: assign first two"?

StackOverflow https://stackoverflow.com/questions/18113407

  •  23-06-2022
  •  | 
  •  

Domanda

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.

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top