2008/09/03


Tumblr - Post to Tumblr : vim online

Script that allows you to post regular type posts to Tumblr.

といっても3行
*** tumblr.vim.orig Wed Sep 03 14:49:50 2008
--- tumblr.vim  Wed Sep 03 14:47:15 2008
***************
*** 50,55 ****
--- 50,58 ----
      url = "http://www.tumblr.com/api/write"
      email = vim.eval("g:tumblr_email")
      password = vim.eval("g:tumblr_password")
+     enc = vim.eval('&encoding')
+     title = title.decode(enc).encode('utf-8')
+     body = body.decode(enc).encode('utf-8')
      data = urllib.urlencode({"email" : email, "password" : password, "title" : title, "body" : body})
      res = urllib.urlopen(url, data)
  

このパッチを当てたtumblr.vimをpluginフォルダに置き
let g:tumblr_email='your@example.com'
let g:tumblr_password='tumblr-password'
と設定し新しいバッファ :TumblrNew
とすると Title:
-- Post follows this line --
と表示されるので、Title部と破線以下に入力し、 :TumblrPost
と実行します。一応rangeにも対応出来ているらしいです。
Textしかポスト出来ませんが、改造すればQuoteも行けるんじゃないですかね。ただvimで編集中のテキストが引用元になるから何がQuoteか分かりませんが...
Posted at by




scons入れてwin32でビルドしてみたよ。ベンチマークも取ってみた。
環境はWindows XP、P4 3GHz CPU、1G memで。

まずmozillaのjsエンジン(ちょっと昔)
JavaScript-C 1.7.0 2007-10-03 (js.exe)
Richards: 87
DeltaBlue: 84
Crypto: 44
RayTrace: 78
EarleyBoyer: 87
----
Score: 74

次にrhino
Rhino 1.6 release 7 (win32 nativeビルド版)
Richards: 6
DeltaBlue: 5
Crypto: 4
RayTrace: 11
EarleyBoyer: 12
----
Score: 7

Rhino 1.7 release 7 2008 03 06(java版 js-14.jar)
Richards: 30
DeltaBlue: 30
Crypto: 24
RayTrace: 47
EarleyBoyer: 53
----
Score: 35

そしてv8エンジン
V8 version 0.2.5 (shell.exe)
Richards: 1020
DeltaBlue: 981
Crypto: 622
RayTrace: 580
EarleyBoyer: 1070
----
Score: 827
はぇーーーーーーーーーーーーーーー!(゚д゚;)

ベンチマークはbenckmarksフォルダにあるrun.jsで起動します。

追記
取り直したらこんな結果もでた
Richards: 1391
DeltaBlue: 1224
Crypto: 940
RayTrace: 774
EarleyBoyer: 1360
----
Score: 1110
もっと詳細が知りたい方は以下を参照。
Google V8 についてしらべてみました - TokuLog 改めB日記
Posted at by



2008/09/02


追記
teramakoさんがもっと良いの 作ってくれました。
きっとそっち使う方が幸せな、ともだちんこになれます。
ですので、私のはubiquityNeta.jsにリネームする事にします。


こう使うのですね?わかります。
(function() {
    if (typeof gUbiquity === 'undefined'return;
    liberator.commands.addUserCommand(["ubiquity"], "Ubiquity",
        function(arg, special){
            var anchor = document.getElementById("content");
            if (window.location == "chrome://browser/content/browser.xul")
                anchor = anchor.selectedBrowser;
            gUbiquity.openWindow(anchor);
            gUbiquity.__textBox.value = arg||'';
            var context = gUbiquity.__makeContext();
            var previewBlock = document.getElementById("cmd-preview").contentDocument.getElementById("preview");
            gUbiquity.__cmdManager.updateInput(arg||'', context, previewBlock);
            if (special) {
                gUbiquity.__cmdManager.execute(context);
                gUbiquity.closeWindow();
            }
        },
    { });
})();
使い方は
:ubiquity map osaka
でプレビュー表示
:ubiquity! map osaka
で直実行です。
ubiquity-vimperator
ソースはcodereposに置いておきます。
ubiquityNeta.js
ubiquityとvimperatorは、ともだちんこですね。わかります。

参考:
ゆびきちが相当面白い!! - ネットランダム

指基地なのか、指既知なのかは置いておいて、ユビキタス度アップ間違いなしのFirefoxアドオンである。

今後、Greasemonkeyにとって変わる可能性すらある。

っていうか、Vimperatorユーザ涙目!

http://d.hatena.ne.jp/fk_2000/20080901/p2
Posted at by