Mozilla Ubiquity: Semantic Web’s Killer App?

Antonio Carlos blogged (in Portuguese) about Mozilla Ubiquity, a fantastic application for Firefox that is being developed by Mozilla Labs. The video below shows you how it works.


Ubiquity for Firefox from Aza Raskin on Vimeo.

After installing the plugin I got really excited about what can be done. It’s more than Quicksilver-for-Firefox; Greasemonkey brought some possibilities but Ubiquity is the glue we need to get mashups up to the next level. The built-in commands work only based on famous sites like Google, Twitter and Wikipedia. In the community commands page you have several more but still always related to websites. As Aza Raskin says in the video the real power of Ubiquity will be unleashed when the tool consume microformats. If you think about RESTful webservices and common data formats the possibility of a completely new web experience is more real than ever.

It currently includes jQuery so if you have knowledge in this very famous JavaScript library writing apps for Ubiquity shouldn’t be a problem. As that’s not the case with me I’ve built a very hacky application instead of using it properly:

var profileTemplate = '<img src="${pic}" width=50 height=50></img><h3>${name}</h3> <em>${website}</em>';

function profileUrlFor(twerName){
  pieces = twerName.text.split(" ")
  reverseName = pieces[1] + ",+" + pieces[0];
  return "http://www.thoughtworks.com/who-we-are/our-people/profiles/"+ reverseName + ".html"
}

CmdUtils.CreateCommand({
  takes: {"ThoughtWorker": noun_arb_text},
  homepage: "http://fragmental.tw",
  author: {name: "Phillip Calcado"},
  description: "Got a favourite ThoughtWorker?",
  icon: "http://www.thoughtworks.com/images/logo.gif",
  name: "twer",
  preview: function( pblock, twerName ) {
    twerWebsite = "http://www.thoughtworks.com";

    pblock.innerHTML = "<em>searching... Lotus Notes is lazy today...</em>"

    jQuery.get(profileUrlFor(twerName),
      {},
      function(htmlSrc){
         if(htmlSrc.search("Document last modified")>0){
          var picStart = htmlSrc.search("http://megaton.thoughtworks.com");
          var picLength = (htmlSrc.search("FieldElemFormat") + 19) - picStart;
          var twerPicUrl = htmlSrc.substr(picStart, picLength);

          var blogSnippetStart = htmlSrc.search("Link to my personal home page:") + 40;
          var blogSnippet = htmlSrc.substr(blogSnippetStart, (htmlSrc.search("Pets:") - blogSnippetStart));

          var blogUrlStart = blogSnippet.search("http");
          var blogUrlLength = blogSnippet.search(">") - blogUrlStart -1;
          var twerWebsite =  blogSnippet.substr(blogUrlStart, blogUrlLength);

          pblock.innerHTML =  CmdUtils.renderTemplate(profileTemplate, {pic: twerPicUrl, name: twerName.text, website:twerWebsite});
        } else{
          pblock.innerHTML = "No idea."
        }
    });
  },
  execute: function(twerName){
     Utils.openUrlInBrowser(profileUrlFor(twerName));
  }
})

You type “twer [name of a thoughtworker]” It searches the ThoughtWorkers Public Profile page and displays the name, picture and blog for the person. If you press enter it will open the person’s profile page.

Of course it’s very nasty and won’t work if you don’t supply the exact name. Anyway for a 30 minutes application it is fairly functional.

3 Responses to “Mozilla Ubiquity: Semantic Web’s Killer App?”


  1. 1 Antonio Carlos Silveira Aug 29th, 2008 at 3:41 am

    NIce App Phillip :-)

  2. 2 Markus Aug 29th, 2008 at 6:30 pm

    Great article! I am also totaly on fire by this :)

  1. 1 Google NativeClient and Yahoo! BrowserPlus: ActiveX Strikes Back? at Fragmental.tw Pingback on Dec 16th, 2008 at 4:51 pm

Leave a Reply








Creative Commons License

This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.