RTをするのが面倒であんまりやり方を知らない。
そこでUbiquityでコマンドを書いてみた。
CmdUtils.CreateCommand({
names: ['rt', 'retweet'],
icon: 'http://twitter.com/favicon.ico',
description: 'retweet',
help: 'retweet',
author: { name: 'makoto_kw', email: 'makoto.kw+ubiquity@gmail.com'},
license: 'BSD license',
homeUrl: 'http://twitter.com/home',
arguments: [
{role: 'object', nountype: noun_arb_text, label:'new tweet'},
{role: 'source', nountype: noun_arb_text , label:'retweet'},
],
preview: 'Inserts status (tweet).',
execute: function(arguments) {
var rt = arguments.source.text || Application.activeWindow.activeTab.document.location;
var status = arguments.object.text + ' RT ' + rt;
Utils.openUrlInBrowser(this.homeUrl + Utils.paramsToString({status: status}));
}
});
noun_type_urlを使えばタブで開いているURLが入る!と信じたが、どうも最初に実行したurlのまま別のタブで動かしても変わらない。
とりあえずApplication.activeWindow.activeTab.document.locationを見ることにした。