
The URL Builder Module in Yahoo Pipes allows you to manipulate and control how URLs are constructed. URLs are built from three main parts.
http://finance.yahoo.com/rss/headline?s=tktm
That URL returns news stories and stock quotes for Tickemaster. To get news and stock quotes for another company, we can simply change the “tktm” to another stock symbol. Lets do Ebay. Their stock quote is simply that – “ebay”. So now our URL would look like this:
http://finance.yahoo.com/rss/headline?s=ebay
URLs are built from three main parts. The first being the server name. In this case, it’s “finance.yahoo.com”. The second part is the resource path, which is everything after the server name, up to (but not including) the “?” (“/rss/headline”). After the “?” is a series of parameters. In this example, the only parameter is “s”. The parameter name and its value are separated by an equal sign “=”, giving us “s=tktm” or “s=ebay”.
If we want to use this feed in our Yahoo Pipe, we could just use the “Fetch Feed Module” but then our Pipe would be reading data for just one stock quote. We could also wire in a “URL Input Module”, but then the user would have to enter in the entire URL. The easiest way to get stock quotes for any company is to use the URL Builder. The URL Builder Module will construct the URL. We can wire a “Text Input Module” into the appropriate part of the URL Builder so all the user would have to type is the stock symbol they want to look up.
http://search.twitter.com/search.atom?q=mgmt%20songs
In this example, we are going to build a search form for people to search for tweets on Twitter using keywords they specify. In order to do this, we can use the URL Builder Module.
I already have an RSS feed setup from Twitter for the search “mgmt songs”. MGMT is a popular indie band and I want to stay up to date with all the Twitter news about them.
Our RSS URL looks like this:
http://search.twitter.com/search.atom?q=mgmt%20songs
We know that every Twitter RSS feed URL has the same format:
http://search.twitter.com/search.atom?q=xxxxxx (where xxxxxx is the search query)
So we can use this to our advantage to make a Pipe for people to search Twitter.
The URL Builder Module has several text boxes, but we only want to put our URL in the “Base” for now.

Now, if we click on the blue header bar of the URL Builder Module (so it turns orange), our URL will automatically be split up for us into path elements and query parameters.
In this case there are no path elements, but our query parameter is “mgmt songs”.

In the Debugger pane we can see our URL:
Now because each Twitter RSS feed URL has the same structure, we can replace “mgmt songs” with anything we want to search for.
We can replace it with “Olympic games” and our URL in the Debugger pane will change accordingly:
The URL Builder Module automatically encodes the spaces in our search query to work properly in our URL. As you can see, we typed in “Olympic games”, but our URL says “…”olympic+games”. It automatically adds the “+” which is completely normal.
The thing to remember is – the URL Builder Module only supplies us with the URL. It can’t do anything else. So in order to make something of this URL, we need to plug it into the Fetch Feed Module (because we are dealing with an RSS URL)
We need to connect our URL Builder Module to the little circle beside the text box in the Fetch Feed Module. As soon as we click, drag a little, and hold the bottom connector of our URL Builder Module, all the possible places we can connect it will light up (in this case only the text box in the Fetch Feed Module).
Now you can see that our URL is “wired into” the Fetch Feed Module. That means that any changes we make to the URL Builder Module will automatically be updated in the Fetch Feed Module. That means if we change “Olympic games” back to “mgmt songs” in the query parameter, our Fetch Feed Module would reflect that change and bring up a feed of “mgmt songs” again.
While we have our URL Builder Module wired into the Fetch Feed Module, lets take a look at the Debugger pane:
Now when we change “Olympic games” in the URL Builder Module to “mgmt songs” our Debugger pane reflects the changes:
This is great because we can automatically create new RSS feeds just by changing the search query parameters in Pipes. But now we need to make it so other people can enter what they want and have it be reflected in Pipes. We need the Text Input Module.
Lets name it “twittersearch”, make the Position “1”, make the Prompt “Search Twitter For”, make the Default “mgmt songs” and leave Debug blank.

Now in order for our text input to work, we need to wire it into the second “query parameters” text box of our URL Builder Module.
There you have it. Now we’ve created a very simple yet powerful search tool to get RSS feeds from Twitter! All users have to do is enter their search query and Pipes spits out the RSS feed for it.







Recent Comments