Monday, June 1, 2009

6/2 Pipes Blog

Please add updates@feedmyinbox.com to your address book to make sure you receive these messages in the future.
Pipes Blog - The latest news about Pipes Feed My Inbox

Using YQL Execute to power the Pipes Webservice Module
June 1, 2009 at 4:50 pm

YQL has become a great way to extend Pipes. You can harvest the power of YQL by using YQL statements in the YQL module. Another way of using even more of YQL's power is to use the Pipes Webservice module. This enables you to use YQL's Execute functionality to create javascript functions that will work on your data in any Pipe.

In this blog post we'll go through the steps on how to use YQL Execute to power the Pipes Webservice Module - for the impatient, here's the example Pipe that we'll be creating.

In order to use YQL Execute, you'll need a website to host your XML file. The XML file is where YQL Execute allows you to manipulate data by using server side javascript. We can then post data to YQL via the Pipes Webservice module to allow further processing of our Pipes Data.

Some users on the Pipes message boards asked if we could add a "yindex" element that numbers each item in the output. This becomes trivial when using YQL Execute!

The first thing we will create is our XML file for YQL Execute. You can copy and paste the structure of the XML below, editing only whats inside the execute node. yqlexecuteyindex.png
The execute content is wrapped within a CDATA statement. Since we're dealing with json, we'll import Crockfords json parser and stringifier by using the y.include() method. First, we parse the json data using JSON.parse(), then loop through the json structure and add new elements by using pdata.items[i].new_element_here within the loop. "yindex" is the new item we want added to our Pipes data structure. We then assign a number to yindex within the loop and then use JSON.stringify() to bring it back together. Finally, we assign our "output" variable as our response.object. Then we want to host this XML file on a publicly accessible web host.

Now we'll set up our Pipe. We need to use the URL builder to setup the URL that the Webservice module will access.

In the URL Builder module, we'll use

  • http://query.yahooapis.com as our base
  • v1/public/yql as our Path element
  • These name/values as our query params
    • q: use "http://paul.donnelly.org/yql/yindex.xml" as yindex; select * from yindex where data = @data
    • format: json
    • diagnostics: false

And simply wire the URL builder module into the url terminal in the Web Service module. Be sure to use query.results.result.items as the Path to item list.

Here is the example Pipe that takes the Pipes blog feed, uses YQL execute as a Webservice module to create an additional element in the Pipes data output: "yindex" which adds a number to each item in the Pipes results. Another example YQL Execute statement is: use "http://paul.donnelly.org/yql/random.xml" as ran; select * from ran where data = @data that randomizes a given feed.

 

This email was sent to acollegeguide.com@gmail.comCreate Your Account
Don't want to receive this feed any longer? Unsubscribe here.

Monday, April 27, 2009

Another College Guide Post

So make sure that whatever you do when you are looking into colleges, take into account BIG PICTURE. That is the key. Some of the factors you might want to consider when choosing a college experience are:
-The reputation of the college
-The reputation in the real world of your chosen major
-How much is tuition?
-What kind of people are known to attend there?
-How far the school is from your family and if that is a factor
-Why you are choosing the school (e.g. major, fun, friends, prestige, etc)
-What the other alternatives are

As you consider these factors and more, you'll be able to make a decision and feel good about it. Make sure you are always asking others for help on the subject and getting opinions you trust.

Tuesday, March 24, 2009

Welcome to ACollegeGuide.com on Blogger

Welcome to ACollegeGuide.com on Blogger. See our college preparation guide to help you navigate the stormy waters of preparing for college by giving you the resources and learning tips to help you succeed.

We'll be continuously adding new and relevant content to fill the gaps in your plan to prepare for college. Our goal is that you have a smooth transition from high school to college and that you enter college ready to spend very little time getting up to speed and in the groove before you take off and reach new heights.

Contact us through ACollegeGuide.com for specific subjects you'd like to see covered in our material or questions you'd like to have answered. We're anxious to help.