Pipes webservice module and AppJet

Did you ever want to do something more with Pipes data? By using a Pipes webservice module you can!

There are several ways you can achieve this. You can host your own – or even host it on Google App Engine. Sam Pullara has a great post on how to extend Pipes with GAE here.

One host that we’ve been playing around with is AppJet. Using AppJet as your host for your Pipes webservice module is easy to make, fast and effective. AppJet uses JavaScript as the server side language making it even easier to use for web developers.

For this example, I want to randomize my feed. First you’ll need to create an appjet login, after that you can clone my example AppJet app. Appjet like Pipes lets you view source, which for developers is one of the best ways to learn and see how things work.

Some things to take note. You’ll want to name your AppJet function name “post_<somename here>”. This tells AppJet that you’re posting data to this function. You’ll also want to add page.setMode(“plain”); and var data = JSON.parse(request.params.data); as your first and second line.

appjectss

var data, gives you access to the pipes output data array. You can do whatever you want with it. For my example I just do a randomized sort on it. If you want to manipulate each item in the data array, its easy to loop through it and change the feed as necessary (see my commented code in the AppJet example). You can also add items to the data array by declaring something like: data.items[i].newitem = <whatever>;

pipesWSeditor

AppJet makes it so easy and is a great way to extend Pipes functionality. Here is my example Pipe that will bring it all together.

You’ll want to make sure that “Path to items list:” has a value of “items” or similar for this example to work.

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>