Ubiquity History

I updated the code of the previous experiment (Sharing Ubiquity Commands) such that when you open an URL that contains a shared Ubiquity action, it won't open Ubiquity in preview mode, but display a small icon.

This also allows to display multiple commands on one page, and by using Ubiquity annotation database I could create this command history; such that when you revisit a page where you had already applied some ubiquity commands you will see the icons for each, awaiting re-applying.

See demo video here.

 

Note: The icon and icon insertion code is repurposed from Aza's Mouse Based Ubiquity experiments.

My experimental (read ugly) code is available at  

Sharing Ubiquity Commands

I recently spoke with Aza Raskin at FOWA on Ubiquity commands/annotations sharing. I promised I'll prototype something, here it is…

[see demo video 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:

  1. user: anonymous or with an identity (URI)
  2. web page address (URI)
  3. selected content
  4. 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:

http://events.carsonified.com/fowa/2009/london/workshops#xpointer(start-point(string-range(/html[1]/body[1]/div[3]/div[1]/ul[1]/li[3]/div[1]/h6[1], "", 1, 1))/range-to(end-point(string-range(/html[1]/body[1]/div[3]/div[1]/ul[1]/li[3]/div[1]/div[1]/p[1], "", 59, 1))))

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:

  1. scroll page to the selection, show icon to invoke Ubiquity
  2. wrap selection with div/span and annotate it with RDFa (to allow other extensions to participate)
  3. publish user – annotation relation (on user choice)
  4. 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)

Twitter to employ CAPTCHA tweets to keep bots out

Twitter-captcha

In a near dark future we may have to go this way. Have our public tweets bot proof, and the Twitter API returning base64 encoded images of our tweets instead of text, unless you're a really good friend … then you may have some of your friends sell your plain text tweets to advertisers, friends hacking friends' accounts to harvest more sellable tweets, etc.

Well, that's a dark vision of the future, fueled by the readings I'm doing for a Cyberpunk course at the Peer 2 Peer University.

Ubiquity and “The Semantic Web” (part 2)

I'll assume that who reads this knows what Ubiquity is, if not check it out, it's awesome.

Since Ubiquity can remember edits you do to a page (via edit and save commands), it may also be able to remember what other commands you applied to a piece of content, such that when you revisit that page you'll see a small visual hint (could be similar to Alex Faaborg microformats experiments, or Aza Raskin's mouse Ubiquity experiments) that would let you re-apply the command.

Imagine that you visit a blog post about a party, and the map command is just one click away just because you did it before.

Now, imagine that you go to that blog post about a party sent by a friend, and you will see the map command your friend applied it there.

Moreover, all these commands applied to snippets of content tell what about the content is; in other words it disambiguate that snippet for a machine, and this kind of mappings could be very useful in the information retrieval and Semantic Web areas; they are annotations made not for the sake of annotations, but made because they solved a problem for a human.

Ubiquity could probably do annotation persistence quite easy, while sharing them could be done via Mozilla Weave.

That would be great, how about some interoperability right there on that very page, in that very moment? What if Ubiquity would add (upon applying a command) RDFa to the selected snippet with an rdf:type telling what the subject of the command is, or a microformat … and have additional extensions (like Operator) pick that up on that instant and do amazing things?