快速分享网页到 Twitter 的 ubiquity 命令

July 26th, 2009 - 4 Responses

把以前那个《用 Ubiquity 打造个 hellotxt》下的脚本修改了一下,同步已经没有意义了,封的封,挂的挂。
注意:此命令很可能不支持最新那个 0.5 版的 ubiquity。
命令参数:tw s 和 tw r。自己测试一下就知道啥东东了。需要更多参数请自行定义。
CmdUtils.CreateCommand({
      name: "tw",
      takes: {status: noun_arb_text},
      homepage: "http://blog.loland.net/2008/09/28/58.et",
      author: {name: "sfufoet", homepage: "http://blog.loland.net/"},
      license: "MPL",
     
      preview: function(previewBlock, statusText, mods) {
        var previewTemplate = '</div><br/>' +
                              "将要发布到 twitter 的内容如下: <br/>" +      
                              "<b>${status}</b><br /><br />" +
                              " 总字数为: <b>${chars}</b>";
        var truncateTemplate = "<br />后面 <b>${truncate}</b> [...]

用 ubiquity 调用 Bit.ly 缩短网址

May 20th, 2009 - 4 Responses

很郁闷,过长的链接总是需要手工到 Bit.ly 缩短一下才能贴到 twitter。有了 Bit.ly Ubiquity Command Script,选中文字,按下 ubiquity 的快捷键,输入 bit.ly 回车,全自动替换到输入框。缩短后的网址还会发到剪贴板。

用 Ubiquity 发飞信

May 2nd, 2009 - 13 Responses

在我的推友里看到这篇 中国移动飞信 Fetion API 免费发短信的一些应用。文章里面有个 Ubiquity 命令,很简陋,而且还是新建标签式的。

输入在 Ubiquity 里输入 command-editor 或者打开 chrome://ubiquity/content/editor.html,在输入框的末尾输入以下命令。红色部分需要修改。
CmdUtils.CreateCommand({
  name: "sms",
  takes: {status: noun_arb_text},
  homepage: "http://blog.loland.net/2008/09/28/58.et",
  author: {name: "sfufoet", homepage: "http://blog.loland.net/"},
  license: "MPL",
 
  preview: function(previewBlock, statusText, mods) {
    var previewTemplate = '</div><br/>' +
                          "将要发送到手机的的内容如下: <br/>" +      
                    [...]

两个翻译当前页面为中文的 Ubiquity 命令[不带框架]

December 26th, 2008 - 2 Responses

用小书签来调用 Google 翻译来翻译当前页面,没办法去掉框架。Google 总是自动把没框架的翻译页面自动重定向到有框架的。
奇怪的是,用 Ubiquity 来调用木有框架的翻译页面却可以哦。
下面是两个 Ubiquity 命令,一个是“将当前英文网页翻译为中文”命令:en2zh,另一个是“将当前日文网页翻译为中文”命令:jp2zh。安装打开 Ubiquity ,输入 command-editor,打开命令编辑器,粘贴以下内容:
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) );
},
preview : function(obj){
obj.innerHTML = "将当前英文网页翻译为中文";
[...]

用 Ubiquity 打造个 hellotxt

September 28th, 2008 - 7 Responses

虽然用 hellotxt 可以同步到 plurk、饭否、twitter,但干嘛不用 Ubiquity 来折腾个呢?
尤其是推荐文章的时候超级方便。
先说用法,呼出 Ubiquity,输入“ff [动作] 文字”就可以闪电同步,[动作]部分为 Plurk 所有,可以根据需要输入。输入“ff s”或者“ff share”或者“ff 推”就可以快速分享当前的正在看的页面到三大服务。
为虾米要用 ff 做命令?因为好按,也是分发的首拼音,也好记。不喜欢自己修改代码
复制以下代码,并修改 uid 的值“272105”为你自己的 uid,快速获得自己的 uid:查看自己的头像地址,比如我的:http:
//avatars.plurk.com/272105-small.gif,那串数字就是你的 uid。
按下呼出 Ubiquity 的快捷键,输入:command-editor,回车。粘贴到 Ubiquity 的命令编辑框里面。Ubiquity 会自动保存,关闭 Ubiquity 的命令编辑界面。哦也。
CmdUtils.CreateCommand({
  name: "ff",
  takes: {status: noun_arb_text},
  homepage: "http://blog.loland.net/2008/09/28/58.et",
  author: {name: "sfufoet", homepage: "http://blog.loland.net/"},
  license: "MPL",
 
  preview: function(previewBlock, statusText, mods) {
    var previewTemplate = '</div><br/>' +
                          "将要发布到饭否、plurk、twitter 的内容如下: <br/>" [...]