Tumbling across the friendly pipes

This connected day and age has brought forth the end of isolation. Publishing one’s own essays, news, rants, photos and the like is essentially free-as-in-beer; the scarcity part of the equation has shifted to attention. Scattering these tiny shards of the self all around the intertubes only compounds to the problem: what’s one to do, though? No tool covers all possible needs, nor should we wish to! Remember UNIX philosophy —to do one thing, and to do it well.

Long time FriendFeed users know the solution to self-generated content dispersion. FriendFeed aggregates your different digital selves: for me it’s my blog, my tumblelog, my Twitter feed, my Flickr account, my Google Reader faves… you name it —and by no means I consider myself a social web junkie! (You mean there are worse cases out there? Outrageous!) In any case, Friendfeed takes your tiny social web mini-mes and assembles a coherent footprint out of them. Well, maybe not so coherent, but a footprint for sure.

FriendFeed is as good as the quality of its integration services. They are a-plenty nowadays, around 57 plus a generic RSS connector. My woes have been directed mainly to its Tumblr import abilities: being a tumblelog, I feel the format is rather similar to a single FF entry, only less limited —just as a FF entry is about the same as an overweight twit. I’d like my Tumblr posts to appear at FriendFeed as an entry+comment combination: the entry would carry a link to the original source, while the comment carries the (usually short) post body text. Nobody ever visits my tumblelog directly, so I’d prefer the link to point not to my post, but a further step up the ladder to the original news/wisdom/ditty/whatever that prompted my annotation.

FriendFeed’s Tumblr integration is much more simple, so how about some mad hacking skillz session? Tumblr4FriendFeed is a Yahoo pipe that aims to reach my set goal. It has been tested against the two Tumblr post types I use the most, namely links and photos. It even shortens the original URL by means of a subpipe, Shorten URL, that takes advantage of the very simple API set up by cort.as URL shortening service, just for the sake of it.

By all means, feel free to clone the pipe and play with it! You may import it into FriendFeed using the Custom RSS/Atom service. Don’t forget to select “Include entry description as a comment”, otherwise the body text of your Tumblr posts won’t display. There are undoubtedly many more test cases than the paltry few I fed it, but as far as I am concerned, it just works™. Therefore, I hereby declare this particular itch to be scratched. Thank you for listening.

Pipes vs Spreadsheets: a showdown

It’s time to get techie again! As you may have noticed, I’ve recently added a new item to my sidebar content called Puede que esté en… (that’s Spanish for I might be at…, for my few Spanish-impaired readers). The location displayed below, a link to Google Maps, is an approximate rendering of my current whereabouts, and it’s aggregated from three different sources using Yahoo Pipes:

The three streams are merged and a result is selected according to a priority rating. Current version has a simple fixed implementation: timetable data has the lowest rank, while twits have the highest. It’s a rather complex use for Yahoo Pipes, featuring a master pipe with three subpipes with a pretty high module count. Have I started to reach the limits of the Pipes platform concerning pipe intelligibility?

Musing about combined uses for Pipes and Google Spreadsheets I came across an interesting idea: both platforms, or at least a subset of them, might be isomorphic. Two equivalent languages. Could I implement the same feed mixing goodness in a more compact and expressive way by using a single on-line spreadsheet? Pipes themselves are nothing more than connectors, and they could be replaced advantageously in a spreadsheet context with cell references. These can be absolute or relative, may be constructed on the fly and are amenable to indirection (that’s the point where things get complicated in spreadsheets, and one is usually better off seeking greener pastures in real programming languages). There were limitations by both sides, to be sure. At a glance:

  • Nearly every data mingling in Pipes is painful. And with painful I mean extremely painful. Dynamic data type conversion is handled by the platform and regex modules are of great help, but don’t attempt more than a handful substitutions or concatenations in the same pipe or things could go out of hands really soon. And let’s forget about numerical computations. Spreadsheets are a much more natural medium for all that jazz.
  • User input means are much more accessible on Pipes than on its hypothetical Google Spreadsheets counterpart. Input on Spreadsheets means resorting to a complex API built upon HTTP and Atom extensions: the simplest data entry requires a GET request to find a base URL, an authentication procedure and a PUT with dynamically generated XML content. You may end up altering the whole of a spreadsheet remotely in that fashion, but it’s simply not a practical goal for a mashup to attempt: I only have to picture in my mind the oodles of Javascript that ought to be written —and debugged— to roll my eyes in dismay.

The Spreadsheets feature that puts it in approximate equal footing with Pipes are its functions for external data: a catalogue of spreadsheet functions that allow to retrieve content from outside the sheet for processing. The equivalent in Pipes are Source Modules: less painful to use, but at times less capable —it’s hard to beat full XPath XML data extraction, but then such a feature is overkill in most cases. On the other hand, good luck trying to synthesize feed items with Google Spreadsheets. It just doesn’t work that way. But putting differences aside, Spreadsheets should let me aggregate feeds and process them all the better. Publishing options allow me to emit a feed as a result; thus the full Pipes workflow would be realised, in a more compact way. True?

False. There is a big gotcha lurking beneath Google Spreadsheets surface. Let me demonstrate it:

  1. Create an empty sheet.
  2. In cell A1, add the function =NOW(). That should nicely display the current date.
  3. Now, publish your sheet and look for the More publishing options link, way down on the dialog. Click on it, and generate an URL for a cell-based feed for cell A1.
  4. Open that link in any serious browser (one that supports RSS, I mean). What do you see?

The exact same date that appeared on the spreadsheet when you added the current date function. Now, wait an indeterminate amount of time, and retry. What? That’s not current any more! Plus, there is no caching involved. NOW() is not NOW() (I wonder if it should be called THEN()). Trouble is, spreadsheets are completely unable to update themselves unless an actual edit takes place. And this limitation affects external data functions too. The verdict: Google Spreadsheets are totally unusable for the purpose of aggregating, processing and emitting content. Humble Pipes win big this time with its, well, pipes paradigm.

However, Pipes and Spreadsheets can work together provided any dynamic component of the intended result is implemented on the Pipes side. Spreadsheets can just take on a supporting role, a kind of two-dimensional database. Which is a shame, if you ask me. Just think of the possibilities!

Geocoding while blogger (2)

Welcome! As promised in my previous post, today I am releasing a Greasemonkey script that allows geocoding, using the geo microformat, in Blogger‘s interface. Remember my previous fit of creativity concerning names? Well, I’ve decided to name this one InsertGeo (don’t laugh at me, just click on this link if you want to install it without reading any further; of course, this assumes Greasemonkey is already installed and in good working order on your Firefox). The screen capture next to this paragraph gives an idea about what to expect after installation.

This script will add a button to the Edit Html editor tab on Blogger’s new post and edit post pages. You may select some text in the editing area before pressing the button; the text box will appear filled with the selected text, which may be edited. Or you might prefer not to select anything beforehand: just enter in the text box the address you want to have geocoded. Press OK, and after a (hopefully) short wait you will see the geo microformat code entered in your post.

This is the kind of code the script generates for a certain address (incidentally, where I spent my much remembered last vacations):

  • Address to geocode:

Avenida de la Mojarra, Ayamonte, Huelva, Spain

  • Microformat generated:
<span class="geo">Avenida de la Mojarra, Ayamonte, Huelva, Spain (
  <abbr class="latitude" title="37.186030">37º11'10" N</abbr> 
  <abbr class="longitude" title="-7.338429">7º20'18" W</abbr>)
</span>

Avenida de la Mojarra, Ayamonte, Huelva, Spain (37º11’10” N 7º20’18” W)

The actual geocoding is performed by Yahoo Pipes. There are other services available on the Net, but the flexibility and extensibility of Pipes is as hard a match as you could find. The pipe I am using (also by yours truly) is called geoloc_pipe; if you take a peek at it, you will notice that there is more data built into the feed than it’s needed to compose a geo microformat. In fact, just enough to generate an adr microformat. An idea for further development?