I recently spoke with Aza Raskin at FOWA on Ubiquity commands/annotations sharing. I promised I’ll prototype something, here it is…
(If the video is clipped, try it here)
When someone applies an Ubiquity command to a piece of content that tells us what’s the type of that content. The user is making an annotation which is not made for the annotation sake, but made for solving a real need. That annotation if shared could be useful in various ways.
But first let’s look at all the data involved, consider that Alice is selecting some text on a web page, invokes Ubiquity and types ‘translate to japanese’. We have the folowing elements:
- user: anonymous or with an identity (URI)
- web page address (URI)
- selected content
- Ubiquity command (URI) with arguments
We need to find a way to identify the last 3 components with a single URI. Why? to tap into what URI power: you could bookmark, synchronise bookmarks online, view the applied command in your browser history and just share that “link” via twitter, facebook, etc.
We can already point to a specific location into a web page, provided that that location is emcompassed into an elment that has an id, like:
http://events.carsonified.com/fowa/2009/london/speakers#azaraskin
If that element had no id, we could use XPath to point to it, the full path in the DOM would be:
/html/body/div[3]/div/ul/li[3]/div/a
Or we could just simply assign identifiers like the purple numbers:
http://www.purpleslurple.net/ps.php?theurl=http…events.carsonified.com…speakers#purp199
However we have an specification to address such content — which even does better — it allows addressing of ranges, imagine that your selection crosses element boundaries (and users do such selections), like selecting “What you’ll learn * The advantages to using Objective-J, Atlas and Cappuccino” from the Atlas workshop description. That selection starts with all the content of a heading and ends up in a paragraph. The specification that can address this is XPointer, the URI that points to this selection in that particular web page looks like this:
It is quite verbose, if you want to pass it around you could shorten it to http://bit.ly/lkDFs for example.
Now to pack the Ubiquity command line into, we could use a convention, like:
http://…#ubiquity:command-line;xpointer(…
for example (here the URL is properly escaped):
http://example.com/#ubiquity:translate%20to%20japanese;xpointer%28string-range%28/html[1]/body[1]/p[2],%20%22%22,%201,%2096%29%29 (again shorter would look like http://bit.ly/4uf0bX)
Having this convention, all it is needed is to listen to Ubiquity commands and update the location bar with the Ubiquity URI, and when the user loads a page with such an URI it should reproduce the selection and invoke Ubiquity.
By the magic of Ubiquity and XPointer extension for Firefox, I prototyped it in couple hours. Playing with it I observed the following issues:
- it “records” in the location bar only one (the last) command
- it is bookmarkable but the title of the bookmark doesn’t disclose the existance of the command
- if you share it with someone that opens it in another browser than Firefox, or it has Firefox without Ubiquity, or have Ubiquity but without the command you shared, that person won’t notice anything (just loads the normal page, #ubiquity… is ignored)
For the first issues there are solutions, like storing somewhere (like in tinydb.org) a stack of ‘Ubiquity URIs’ to be applied in a specific order, and
pass the stack identifier around.
I added the command line as a prefix to the title, and solved the second issue; now in browser’s history or in a bookmark the above example reads “translate to japanese: Example Web Page”.
The third issue require an intermediate page that would be shown if the user has no Firefox, Ubiquity or that specific command; but this solution creates other issues:
- it has a different URI, which you need to use explicitly when you share the Ubiquity applied command
- there is no way to detect from a web page that Ubiquity is installed (it is a security risk) or what commands are available
Enough talking, go play with the prototype (you will see the intermediate page mentione above):
http://namebound.com/ubiquity/share
Note: You need to install xpointerlib extension and Ubiquity must be at least 0.5.5pre7.
TODO:
- scroll page to the selection, show icon to invoke Ubiquity
- wrap selection with div/span and annotate it with RDFa (to allow other extensions to participate)
- publish user – annotation relation (on user choice)
- load user, and friends annotations (imagine that Alice visist Bob’s blog post on tonight’s party, and the venue was already mapped with Ubiquity by Fred; Alice will see an icon/hint to apply the map command on that snippet)
No comments yet.
RSS feed for comments on this post. TrackBack URI