My Bookmarklet

  • /*
     * @title My Bookmarklet
     * @description find rel=shortlink practice
     * @include http://*
     * @license MIT License
     * @require 
     */
    (function(){
      var l=document.getElementsByTagName('link');
        for (var i=0;i<l.length;++i){
            if(l[i].hasAttribute('rel')&&l[i].getAttribute('rel').toLowerCase()=='shortlink'){
            var sl=encodeURIComponent(l[i].href);
            break;
            }
        }
    if(sl) window.location.href='https://twitter.com/?status='+encodeURIComponent(document.title)+'%20'+sl;
    })()
    
    
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2011/06/10 19:15:44 - 2011-06-10