Mixing Pipes and Plazes

I keep meaning to write a more detailed post about the changes that have been going on at Plazes, but in the meantime here’s a little doobrey I hacked up the other day.

Plazes now has a REST API (the old, pre-Activities version used to have an XML-RPC API). However, the information it provides is sometimes a little verbose for my purposes… I’d quite like to be able to simply ask the Plazes server “where am i?” and be told in a really simple format. Right now it looks like I need to know my user ID, and then go get http://plazes.com/users/<id>/activity.xml, and then get the name of the <plaze> element from the verbose XML that is returned. Something that just returned my current Plaze would be neater (for things like the ecto Applescript that I based off of Peter Rukavina’s Adium Applescript of days gone by, which used the old WhereAmI API).

So I turned to Yahoo! Pipes to see how I could abbreviate the output. I’ve created a simple Pipe which can return a small piece of JSON containing a user’s location when a user id (short name or number) is provided.

The base Pipe is here. It is not very useful in raw form as Pipes returns RSS by default, so running it will result in an apparently empty result on the web page. Try the JSON option instead.

You can add a user parameter (it defaults to my ID number, 6032), e.g. http://pipes.yahoo.com/pipes/pipe.run?_id=ZCgigzK93BGPeu60ouNLYQ&user=6032&_render=json

Running this query results in a JSON collection containing something like:

"items":[
   {
      "city":"Farnborough",
      "last_updated":"2008-01-07T14:28:00Z",
      "user":"Andy Piper",
      "plaze":"Andy's Office",
      "description":"",
      "title":""
   }
]

Annoyingly, Pipes only allows me to publish JSON or RSS (I’d prefer just simple text, but hey-ho).

Something more I’d like to do with this is to use Project Zero instead of Pipes, and make it more configurable to enable me to get more information on the user and plaze if needed.

Advertisements

4 responses to “Mixing Pipes and Plazes

  1. The closest you will get to plain text is csv output. Change the value of the _render parameter to “csv”.

    Like

  2. Ahh, excellent, thanks. I couldn’t find a list of valid render values in the Pipes documentation.

    Like

  3. I’d like to be able to get Plazes to somehow give me a geo-rss feed. So far I haven’t been able to figure out how to get this. 😦

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s