引用して Twitter

    @@ -14,9 +14,9 @@ else if (window.getSelection) s = window.getSelection(); else - s=null; + s = ""; -if (s) +if (s && s != "") s = '"' + s + '": '; s = s + d.title + " - " + location.href;
  • /*
     * @title 引用して Twitter
     * @description 「"選択中のテキスト": title - URL」という形式で Twitter の登校ページを開く
     * @include http://*
     * @license MIT License
     * @require 
     */
    
    var d = document;
    if (d.selection)
        s = d.selection.createRange().text;
    else if (d.getSelection)
        s = d.getSelection();
    else if (window.getSelection)
        s = window.getSelection();
    else
        s = "";
    
    if (s && s != "")
       s = '"' + s + '": ';
    s = s + d.title + " - " + location.href;
    
    window.location='http://twitter.com/home?status='+encodeURIComponent(s);
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2010/06/14 22:36:00 - 2010-06-14
  2. 2010/06/14 22:34:37 - 2010-06-14
  3. 2010/06/14 22:33:21 - 2010-06-14