
The Sub String Module allows you to grab only part of a string. You need to enter the starting character position and the ending character position to tell Yahoo Pipes what to grab.
In this example, we’re going allow a user to input a YouTube URL into the URL Input Module and extract the “video id” from it by using the Sub String Module.
Let’s use a video from Google “What Is Google Chrome OS?” with the URL http://www.youtube.com/watch?v=0QRO3gKj3qw
Our video id (which we want to extract from the URL) is: 0QRO3gKj3qw
So how do we go about this?
First let’s enter the URL into a URL Input Module…

…and wire it into the Sub String Module…

Now the Sub String Module wants us to enter a starting number for where we want our new string to begin. We want to count the number of characters up to but not including “0QRO3gKj3qw” which is 31. We also need to tell the Sub String Module how long we want our new string to be. We know that each YouTube URL has the same structure and that the video ID will always be 11 characters.

So we can enter “31” in the “From” field and “11” in the “Length” field and viola, our Video ID has been extracted which you can see in the Debugger pane:


Recent Comments