Twitterに「いいね!」をつける。

  • /*
     * @title Twitterに「いいね!」をつける。
     * @description いいね!をつけたい。
     * @include http://twitter*
     * @license MIT License
     * @require jQuery
     */
    $(function(){
    Ene();
    function Ene(){
      //汚い・・・いつか整理。
      var isOld = ($(".tweet-actions").length==0)? true : false ;
      var box = (isOld)? ".meta.entry-meta" : ".tweet-actions" ;  
      console.log(box);
      $.each($(box),function(){
        if($(this).parent().children("iframe").length === 0){
          var url = (!isOld)?($(this).prev().attr("href").split("/#!")[1]):($(this).children(".entry-date").attr("href"));
          if(url){
            url = encodeURIComponent((isOld? '' :"http://twitter.com")+url);
            var html = '\
    <iframe src="http://www.facebook.com/plugins/like.php?href='+url+'&amp;layout=button_count&amp;show_faces=true&amp;width=100&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="display:inline-block; border:none; overflow:hidden; width:70px; height:21px; vertical-align:bottom;" allowTransparency="true"></iframe>';
        $($(this).parent()).prepend(html);
          }
        }
      });
      setTimeout(Ene,10000);
    }
    });
    
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2010/10/17 03:10:10 - 2010-10-17
  2. 2010/10/17 03:05:32 - 2010-10-17
  3. 2010/10/17 03:04:00 - 2010-10-17
  4. 2010/10/17 03:02:07 - 2010-10-17
  5. 2010/10/17 02:59:41 - 2010-10-17
  6. 2010/10/17 02:58:12 - 2010-10-17
  7. 2010/10/17 02:54:43 - 2010-10-17
  8. 2010/10/17 02:52:42 - 2010-10-17
  9. 2010/10/17 02:50:01 - 2010-10-17
  10. 2010/10/17 02:49:03 - 2010-10-17
  11. 2010/10/17 02:46:20 - 2010-10-17
  12. 2010/10/17 02:45:23 - 2010-10-17
  13. 2010/10/17 02:44:55 - 2010-10-17
  14. 2010/10/17 02:38:10 - 2010-10-17
  15. 2010/10/17 02:32:17 - 2010-10-17
  16. 2010/10/17 02:29:46 - 2010-10-17
  17. 2010/10/17 02:24:24 - 2010-10-17
  18. 2010/10/17 02:23:23 - 2010-10-17
  19. 2010/10/17 02:22:01 - 2010-10-17
  20. 2010/10/17 02:20:38 - 2010-10-17
  21. 2010/10/17 02:16:00 - 2010-10-17
  22. 2010/10/17 02:15:05 - 2010-10-17
  23. 2010/10/17 02:10:10 - 2010-10-17
  24. 2010/10/17 02:08:31 - 2010-10-17
  25. 2010/10/17 02:07:25 - 2010-10-17
  26. 2010/10/17 02:05:48 - 2010-10-17
  27. 2010/10/17 02:04:01 - 2010-10-17
  28. 2010/10/17 02:02:04 - 2010-10-17
  29. 2010/10/17 01:58:06 - 2010-10-17
  30. 2010/10/17 01:55:50 - 2010-10-17
  31. 2010/10/17 01:54:48 - 2010-10-17
  32. 2010/10/17 01:53:39 - 2010-10-17
  33. 2010/10/17 01:51:45 - 2010-10-17
  34. 2010/10/17 01:49:09 - 2010-10-17
  35. 2010/10/17 01:48:07 - 2010-10-17
  36. 2010/10/17 01:47:11 - 2010-10-17
  37. 2010/10/17 01:45:30 - 2010-10-17
  38. 2010/10/17 01:43:57 - 2010-10-17
  39. 2010/10/17 01:43:25 - 2010-10-17
  40. 2010/10/17 01:39:07 - 2010-10-17