Ubiquiti Hack

时间:2008-08-27 20:25:08

标签: ubiquity

您为Mozilla的新Ubiquity工具发现的最有用的黑客是什么?

6 个答案:

答案 0 :(得分:3)

我几天前写过: http://www.appidx.com/ubiq/stackoverflow.html

执行部分拒绝使用POST数据运行。代码是正确的代码,我尝试使用XUL组件javascript的函数的本机代码,它同样拒绝运行。任何帮助,将不胜感激。另一方面,预览效果很好。

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);
  },
})

答案 1 :(得分:2)

它可以更快地关闭Firefox,然后我可以用鼠标和角落里的那个小东西...... :-P

答案 2 :(得分:2)

“翻译此”和“编辑页面”。我认为如果Google Apps功能支持托管域,我会发现它们很有用。

答案 3 :(得分:2)

我刚刚写了这个:

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

好玩具!

现在我需要弄清楚如何使用JQuery和Ubiquity将POST发送到http://Beta.StackOverflow.Com/search ...如果只有一个网站我可以提出这个问题!

答案 4 :(得分:1)

我经常使用“发送电子邮件”和“推特”命令

答案 5 :(得分:0)

我的同事安装后在他的机器上有3个蓝屏。并不完全相信这是做了什么,但这是他今天唯一改变的事情。我现在正在卸载它(他也是如此)。