[twitter:@ACCOUNT][twitter:ID:detail]

    @@ -1,6 +1,6 @@ /* * @title [twitter:ID:detail] - * @description Quote a tweet with Hatena Twtter Syntax + * @description Quote a tweet in Hatena Twitter Syntax with <at>account * @include http://twitter.com/* * @include https://twitter.com/* * @license MIT License http://nrm.mit-license.org/2012 @@ -8,8 +8,10 @@ */ (function () { - var id = (/https?:\/\/twitter\.com\/[\w]+\/status\/(\d+)/.exec(location.href) || [])[1]; - if (!id) return; + // https://twitter.com/github/status/212578113094299648 + var meta = (/https?:\/\/twitter\.com\/([\w]+)\/status\/(\d+)/.exec(location.href) || []).slice(1); + if (meta < 2) return; - prompt('Copy Me', '[twitter:' + id + ':detail]'); -})(); + var syntax = '[twitter:@' + meta[0].toLowerCase() + ']' + '[twitter:' + meta[1] + ':detail]'; + prompt('Copy Me', syntax); // TODO prompt '\n' +})();
  • /*
     * @title [twitter:ID:detail]
     * @description Quote a tweet in Hatena Twitter Syntax with <at>account
     * @include http://twitter.com/*
     * @include https://twitter.com/*
     * @license MIT License http://nrm.mit-license.org/2012
     * @require
     */
    
    (function () {
        // https://twitter.com/github/status/212578113094299648
        var meta = (/https?:\/\/twitter\.com\/([\w]+)\/status\/(\d+)/.exec(location.href) || []).slice(1);
        if (meta < 2) return;
    
        var syntax = '[twitter:@' + meta[0].toLowerCase() + ']' + '[twitter:' + meta[1] + ':detail]';
        prompt('Copy Me', syntax); // TODO prompt '\n'
    })();
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2012/06/14 04:49:32 - 2012-06-14
  2. 2012/06/14 02:18:24 - 2012-06-14
  3. 2012/06/14 02:13:17 - 2012-06-14
  4. 2012/06/14 02:11:35 - 2012-06-14
  5. 2012/06/14 01:45:33 - 2012-06-14