Twitterの名前部分を洒落たフォントにする

    @@ -1,9 +1,34 @@ /* - * @title bookmarklet - * @description my bookmarklet - * @include http://* + * @title Twitterの名前部分を洒落たフォントにする + * @description Twitterのscreen_nameとuser_nameのフォントをGoogle Font APIから適当に引っ張ってきたフォントに変更します。 + * @include http://twitter.com/ * @license MIT License * @require */ - +(function(api){ + var api2 = api; + api.type = api2.type = "text/javascript"; + api.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js"; + api2.src = "http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js"; + document.body.appendChild(api); + document.body.appendChild(api2); + if(location.href.indexOf('http://twitter.com/') != -1){ + setTimeout(function(){ + if(!window.jQuery || !window.WebFont) arguments.callee; + else { + WebFont.load({ + google:{ + families: ['Lobster', 'Yanone Kaffeesatz'] + } + }); + $('.screen-name').css('font-family', 'Lobster'); + $('.username').css('font-family', 'Yanone Kaffeesatz'); + $('a.screen-name, a.username').css({ + 'font-weight': 'bold', + 'font-size': '120%' + }); + } + },100); + } +})(document.createElement("script"));
  • /*
     * @title Twitterの名前部分を洒落たフォントにする
     * @description Twitterのscreen_nameとuser_nameのフォントをGoogle Font APIから適当に引っ張ってきたフォントに変更します。
     * @include http://twitter.com/
     * @license MIT License
     * @require 
     */
    
    (function(api){
      var api2 = api;
      api.type = api2.type = "text/javascript";
      api.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js";
      api2.src = "http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js";
      document.body.appendChild(api);
      document.body.appendChild(api2);
      if(location.href.indexOf('http://twitter.com/') != -1){
        setTimeout(function(){
          if(!window.jQuery || !window.WebFont) arguments.callee;
          else {
            WebFont.load({
              google:{
                families: ['Lobster', 'Yanone Kaffeesatz']
              }
            });
            $('.screen-name').css('font-family', 'Lobster');
            $('.username').css('font-family', 'Yanone Kaffeesatz');
            $('a.screen-name, a.username').css({
              'font-weight': 'bold',
              'font-size': '120%'
            });
          }
        },100);
      }
    })(document.createElement("script"));
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2010/05/20 14:33:06 - 2010-05-20
  2. 2010/05/20 14:17:17 - 2010-05-20