Skip to content

Instantly share code, notes, and snippets.

/* Mozilla Ubiquity Command for diigo, currently only support add bookmark.
* Some code from https://ubiquity.mozilla.com/standard-feeds/social.js
*/
var store = Application.storage;
const diigo_CUR_LOGIN = "ubiquity_diigo_cur_login";
var Choices = {"yes": "y", "no": "n"};
var noun_type_share = {
_name: "yes/no",
suggest: function( text, html ) {
CmdUtils.CreateCommand({
name: "en2zh",
icon: "http://www.google.com/favicon.ico",
description: "将当前英文网页翻译为中文",
execute: function() {
var word = context.focusedWindow.document.location;
Utils.openUrlInBrowser( "http://72.14.235.104/translate_c?sl=en&tl=zh-CN&hl=zh-CN&ie=UTF-8&u=" +
escape(word) );
},
CmdUtils.CreateCommand({
name: "r-douban",
homepage: "http://www.douban.com/people/aka/",
author: { name: "Yu Peng", email: "pengyu.py@gmail.com"},
contributors: ["Yu Peng"],
license: "MPL",
description: "Recommend the current site to douban",
help: "posts the current tab url to douban with the comment input by the user.",
_params: function(comment,mods) {
@xbourn
xbourn / x
Created March 10, 2009 03:17
makeSearchCommand({
name: "scholar",
url: "http://www.google.com/scholar?q={QUERY}",
icon: "http://www.google.com/favicon.ico",
description: "Searches Google Scholar for a paper."
});
makeSearchCommand({
name: "mininova",
url: "http://www.mininova.org/search/?search={QUERY}",
@xbourn
xbourn / x
Created March 10, 2009 02:34
makeSearchCommand({
name: "Baidu",
url: "http://www.baidu.com/s?wd={QUERY}",
icon: "http://www.baidu.com/favicon.ico",
homepage: "http://blog.eshangrao.com/",
author: { name: "feiy", email: "eshangrao@gmail.com"},
contributors: ["feiy"],
license: "MPL",
description: "Searches Baidu for your words.",
preview: function(pblock, directObject) {