plumber!s toolbox

tips, tricks, techniques, and tools for yahoo! pipes
by alex ibrado
Apr 15

Case-insensitive regex

You can specify “i” in the Regex operator, but what about the Filter operator and String Regex module?

Simple. Just prefix your regex with (?i) — this makes the match case-insensitive for the remainder of the string.


pipes.yahoo.com/plumber/ciregex

Parameter reuse


It may not be immediately obvious, but you can wire the output of various Inputs and Builders as many times as you need.


pipes.yahoo.com/plumber/reuseparam

Apr 14

Counter (for loop)

A loop that counts from A to B is quite useful for the times when you need to repeat a certain operation X times.

This module is similar to Mauricio Scheffer’s, but uses an internal string for the number source instead of pulling in a CSV file from a remote host. By default, it’s limited to a max of 1000 loops as well, but you can just add more numbers.

To use this, clone it and drag into your editor from “My pipes” into a Loop where you embed your desired action. The counter is accessible as “item.i”. Note that the silly “+ 0” loop is a workaround for a bug in the String Tokenizer, where it tokenizes 0 to an empty string.

Here’s a bash one-liner to make more numbers. Just copy and paste the values into the String Builder.

limit=2000; (for ((i=0;i < $limit; ++i)); do echo -n $i; if [ $i -ne (( $limit-1 )) ]; echo -n , ’ ) > $limit-numbers.csv

pipes.yahoo.com/plumber/counter

Feed switch

You can use this technique for any problem that requires runtime modification of the pipe output, for instance, when you use a feed with embeddable gadgets.

In this example, you can exclude descriptions (excerpts) by specifying an xd parameter value of 1.

pipes.yahoo.com/plumber/feedswitch