views:

925

answers:

7
+4  Q: 

Ubiquity Hack

What's the most useful hack you've discovered for Mozilla's new Ubiquity tool?

+2  A: 

That it can close Firefox faster then I can with the mouse and that little [x] thing in the corner... :-P

nlucaroni
+3  A: 

A simple one, actually.. "google this" :)

Joril
A: 

My co-worker has had 3 blue-screens on his machine since installing it. Not totally convinced this is what did it, but it's the only thing he's changed today. I'm uninstalling it for now (and so is he).

Corey McKinnon
JavaScript extensions, like Ubiquity, don't cause bluescreens. Faulty drivers and hardware causes bluescreens. Sigh...
Nickolay
+2  A: 

"translate this" and "edit-page". I think I'd find the Google Apps features useful if they supported hosted domains.

Peter Stone
+2  A: 

I just wrote this:

makeSearchCommand({
  name: "stackoverflow-tagsearch",
  author: { name: "Jörg W Mittag", email: "[email protected]"},
  license: "MIT X11",
  url: "http://Beta.StackOverflow.Com/questions/tagged/{QUERY}",
  icon: "http://StackOverflow.Com/favicon.ico",
  description: "Searches <a href=\"http://StackOverflow.Com\"&gt;StackOverflow.Com&lt;/a&gt; for the given tag(s).",
  help: "Searches <a href=\"http://StackOverflow.Com\"&gt;StackOverflow.Com&lt;/a&gt; for the given tag(s).",
  preview: function(pBlock, directObj) {
  if (directObj.text)
    pBlock.innerHtml = "Searches <a href=\"http://StackOverflow.Com\"&gt;StackOverflow.Com&lt;/a&gt; for " + directObj.text;
  else
    pBlock.innerHTML = "Searches <a href=\"http://StackOverflow.Com\"&gt;StackOverflow.Com&lt;/a&gt; for the given tag(s).";
  }
});

Nice toy!

Now I need to figure out how to HTTP POST to http://Beta.StackOverflow.Com/search with JQuery and Ubiquity ... If only there was a site where I could ask that question!

Jörg W Mittag
+3  A: 

I wrote this a few days ago: http://www.appidx.com/ubiq/stackoverflow.html

The execute portion refuses to run with POST data. The code is the right code, and I've tried with the native code of the function with the XUL component javascript and it likewise refuses to run. Any help would be appreciated. The preview on the other hand works fine.

CmdUtils.CreateCommand({
  name: "stackoverflow",
  author: {name: "Aryeh Goldsmith"},
  homepage: "http://www.appidx.com/ubiq/",
  icon: "http://stackoverflow.com/favicon.ico",
  takes: {search: noun_arb_text},
  license: "MPL",
  description: "Searches the highlighted text on stackoverflow.",
  _version: "52",

  preview: function ( pblock, inputObject) {
    var query = inputObject.text;
    pblock.innerHTML = "Search stackoverflow.com for " + query + "<br/>";

    var url = "http://stackoverflow.com/search";
    params = {"search-text": query, "hiddenstuff": ''};

    jQuery.post( url, params, function( html ) {
      var $ = jQuery;
      pblock.innerHTML += "<div style='display:none;'>" + html + "</div>";
      var ques = $(pblock).find('.summary h3');
      var details = $(pblock).find('.summary .excerpt');
      var out = "<div style='margin-bottom: 6px;'><b>Previewing the first 5 results:</b></div>";
      for (var j = 0; j< ques.size() && j < 5; j++) {
        out += "<div style='padding: 5px;'><b>" + ques[j].innerHTML + "</b><br />";
        out += details[j].innerHTML + "</div>";
      }
      pblock.innerHTML = out;
    });
    },

  execute: function( inputObject ) {
    var query = inputObject.text;
    var url = "http://stackoverflow.com/search";
    var params = {
      "search-text": query,
      hiddenstuff: ""
    };

// The following refuses to work... why? I just don't know! AFAIK it's correct.
    openUrl(url, params);
  },
})
aryeh
+1  A: 

I use a lot the "email it" and the "twitter" commands

fernandogarcez