/* Tweet Me! The MIT License Copyright (c) 2008 Masahiko Tachizono Based on Yuichiro Masui's Hatebu Anywhere (http://blog.masuidrive.jp/index.php/2008/04/17/released-hatena-bookmark-anywhere/). */ var tweet_me_style; // falseを設定するとCSSでスタイルの指定が可能になる var tweet_me_limit = 10; // 表示件数 var tweet_me_url; // 表示するURL 未指定の場合、このページ function __tweet_me_anywhere_receiver(json) { try { var html = ""; var escapeHTML = function(str) { str = str.replace("&","&"); str = str.replace("\"","""); str = str.replace("'","'"); str = str.replace("<","<"); str = str.replace(">",">"); return str; } // http://juce6ox.blogspot.com/2007/11/cssdom.html // by latchet var addCSSRule = (document.createStyleSheet) ? (function(sheet){ return function(selector, declaration){ sheet.addRule(selector, declaration); }; })(document.createStyleSheet()) : (function(sheet){ return function(selector, declaration){ sheet.insertRule(selector + '{' + declaration + '}', sheet.cssRules.length); }; })((function(e){ e.appendChild(document.createTextNode('')); (document.getElementsByTagName('head')[0] || (function(h){ document.documentElement.insertBefore(h, this.firstChild); return h; })(document.createElement('head'))).appendChild(e); return e.sheet; })(document.createElement('style'))) if(tweet_me_style!==false) { addCSSRule(".tweet_me_box", "background-color: #F1FCFD; margin: 2px; padding: 15px; font-size:12px;"); addCSSRule(".tweet_me_avator", "float: left; margin: 5px;"); addCSSRule(".tweet_me_result", "list-style-type: none; padding: 2px; margin: 0px; background-color: #F1FCFD;"); addCSSRule(".tweet_me_result li", "border-bottom: 1px dotted #AAAAAA; list-style-type: none; padding: 3px;"); addCSSRule(".tweet_me_avator", "float: left; margin: 5px;"); addCSSRule(".tweet_me_info", "color: #777;"); addCSSRule(".tweet_me_powered_by", "display:none;"); addCSSRule(".tweet_me_clearer", "clear: both;"); addCSSRule(".tweet_me_url", "color: #aaa;"); addCSSRule(".tubu a", "float:right; font-size:12px; color:#6666CC; margin-right:20px;"); } if(json==null) { html += "この記事へのつぶやき"; html += "つぶやく"; html += "
"; } else { if((typeof tweet_me_limit)!="number") tweet_me_limit = 100; html += "
"; html += "Twitterでの反応 "; html += "

"; html += "
"; html += "
    "; for(var i=0; i0; ++i) { var tweet = json.results[i]; // tweet.text.replace(tweet_me_url, "" + tweet_me_url + ""); var t = tweet.created_at.split(" ")[0].split("/"); var tags = []; if(tweet.text!='') { html += "
  • "; html += "
    "; html += ""; html += "
    "; html += "
    "; html += "" + tweet.from_user + ": "; html += tweet.text; html += "
    "; html += "
    "; html += tweet.created_at; html += " - リプライ - "; html += "このつぶやきを見る"; html += "
    "; html += "

    "; html += "
  • "; tweet_me_limit--; } } html += "
"; html += "
"; html += "Powered by Twitter"; html += "
"; } var wrap = document.createElement("div"); wrap.innerHTML = html; document.getElementById("tweet_me_here").appendChild(wrap); } catch(e) { } } function __tweet_me_anywhere_load() { try { if((typeof document.getElementById("tweet_me_anywhere"))!="undefined") { var script = document.createElement("script"); script.setAttribute("type","text/javascript"); if((typeof tweet_me_url)=="undefined") tweet_me_url = location.href.replace(/#.*/,""); script.setAttribute("src","http://search.twitter.com/search.json?q="+tweet_me_url+"&callback=__tweet_me_anywhere_receiver"); document.body.appendChild(script); } } catch(e) { } } try { if(window.addEventListener) { window.addEventListener("load", __tweet_me_anywhere_load, false); } else { window.attachEvent("onload", __tweet_me_anywhere_load); } } catch(e) { }