Archive for the 'Developers' Category

New Yahoo! Pipes PHP serialized output renderer

Wednesday, April 2nd, 2008

Until now JSON output has been the only way to obtain all the data flowing through a Pipe. Starting today we’ve added a second way of getting all the data - serialized PHP Pipe output.

To get this, go to your Pipe -> More options -> Get as PHP. Right click the “Get as PHP” link to copy link location (or copy shortcut if using IE).

phpdropdown.png

After obtaining the link location, you can do something as simple as this to get Pipe output data as an array into your PHP script.

// Pipes Request
$req = 'http://pipes.yahoo.com/pipes/pipe.run?_id=ZKJobpaj3BGZOew9G8evXg&_render=php‘;
// Make the request
$phpserialized = file_get_contents($req);
// Parse the serialized response
$phparray = unserialize($phpserialized);

To view the array in your web browser, use this piece of PHP code to help visualize the array.

print_r($phparray);

print_r.png

To view a code sample on how to do a request go here. To read more about serialized PHP at Yahoo!, go here.

It’s then up to you on how you want to display or use the Pipe data. The possibilities are endless.

Introducing - Pipe Badges!

Monday, March 24th, 2008

Did you ever want an easy way of putting Pipes output onto your website or blog?

Introducing - Pipes badges!

We currently have three types of badges - map, image and list. Map badges are available if there is geocoded data in the feed. Image badges are available if there are media images in the feed. List badges will always be present if there is valid data.

Yahoo! Pipes Map BadgeYahoo! Pipes Image BadgeYahoo! Pipes List Badge

Read more about how to configure them here.

You’ll notice that on the Pipe info pages there is a new link called “Get as a Badge.”

Get as a Badge
Click on the “Get as a Badge” link and a wizard will guide you on adding it to certain destinations like your WordPress blog, iGoogle page or any web site (that supports Javascript).

Yahoo! Pipes Badge Wizard

For those of you that are more technically inclined, we are using a script node replacement technique that uses JSON embedded configuration (This is based on Kent Brewsters “Case Harded Javascript”).

New “Fetch Page” module and nice web path enhancement…

Thursday, December 6th, 2007

This week we have two updates to our site: A new module to fetch a pages source and a small fix for easy web paths when running a Pipe.

This weeks release incorporates a new module named “Fetch Page”. The new module will fetch the source of a given web site as a string. This data can then be converted into a RSS feed or merged with other data in your Pipe using the Regex module. The module is located under the “Sources” menu in the editor.
Thumbnail for fetch page
The module can fetch an entire page or you can specify a “starting” and “ending” point. We also offer support for specifying a delimiter to allow you to easily separate the text into strings.
fetch-page-blog-image-1-thumb.png
Our team as also created a few examples:
1) Fetch Page Example #1 is our first example. The goal of this Pipe is to extract train schedules from a local train scheduled provided in the San Francisco Bay Area.
2) Fetch Page Example #2 is a simple example that utilizes the first example as a sub-Pipe to obtain addition train stops.

Additional information about this new module along with its limitations can be found in the documentation modules/sources section.

Our second change to the site this week is a minor fix/enhancement to allow for easy web paths of all Pipe.runs page. This will allow you to use the easy paths you created for your Pipes. For example, the Pipe above “Fetch Page Example #1″ would look like the following below (please note the “?” instead of the “&”):

Original name:
“http://pipes.yahoo.com/pipes/pipe.run?_id=1qoLq6ai3BGv06982R2EvQ&_render=rss&station=Palo+Alto”

Easy web address name:
“http://pipes.yahoo.com/pipes_team/fetch_page_example?_render=rss&station=Palo+Alto”

New “Private” field support for passwords, application IDs and more

Monday, November 19th, 2007

Four nice changes to Pipes this week.

First, ever wanted to share your Pipe but not your username, password or application ID? Now you can! Pipes now supports “private” fields in two new modules, the private input module and the private string module. Private fields are not visible to anyone but the Pipe creator, and are not copied if the Pipe is cloned. If a Pipe user doesn’t provide a value for a private input field, then any “default” value provided by the Pipe creator continues to be used - so your Pipes will run for anyone but only you can see the private values.

privateinput.jpg privatestring.jpg

Secondly, in addition to the new private modules we’ve added a “source” view for HTML formatted data in the editor’s debugger. So now those filters and regexes get a lot easier to write when you can easily browse the source directly:

html.jpg

source.jpg
Thirdly, we’ve enabled direct editing for the field selection drop down controls in the editor. This doesn’t sounds like a big deal until you realize you can now add array offsets to dig down into sub-arrays in the data, in any module (not just regex), or work on fields that aren’t currently flowing through the Pipe. For example, want to get at the first link in your raw ATOM feed? Rather than referring to the field as item.link.href, just type item.link.0.href
array.jpg

Finally, the Google feed issues we started experiencing last week should now be thing of the past. No more captchas. Yay!

Power Your Own Module

Monday, August 13th, 2007

We’ve added a new Web Service module to Pipes that allows developers to power their own modules and extend the functionality Pipes offers.

In the Pipes Editor, the new Web Service module is listed under Operators:

  • The Web Service module POSTs the items in a pipe in JSON format to an external web service. This allows developers to extend the functionality Pipes offers to do whatever they need. The original items are replaced by the web services JSON or RSS response. Here’s an example.
    Web Service Module

Note: We’ve documented the source code for the web service that we call in the example pipe.

Pipes adds Flash Developer Support

Saturday, March 10th, 2007

We setup an open crossdomain.xml file at pipes.yahooapis.com. This update allows Flash developers to get the output of a Pipe in JSON or RSS formats.

To access your Pipe from Flash you need to take the following steps:

1. Find the JSON or RSS URL for the Pipe you want to call. After you run a Pipe you can find these links in the “Subscribe” tab. Here’s an example URL for the RSS feed of a Pipe:
http://pipes.yahoo.com/pipes/pipe.run?_id=5BiciiOz2xGc28CWpRr.og&query=rss&username=joshua&_render=rss

2. Replace the domain name in the above URL from “yahoo” to “yahooapis”. Here’s an example of the change:
http://pipes.yahooapis.com/pipes/pipe.run?_id=5BiciiOz2xGc28CWpRr.og&query=rss&username=joshua&_render=rss

Pipes Blog is powered by WordPress | Entries (RSS) and Comments (RSS).