/********************************* ** つぶやき投稿 **********************************/ function tweet() { var bitly = 'http://api.bit.ly/shorten' + '?version=2.0.1' + '&format=json' + '&callback=callback' + getHttpResponse("/twitter/include/twitter_proxy.cfm?a=1").replace(/(^\s+)|(\s+$)/g, "") + '&longUrl=' ; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = bitly + encodeURIComponent(document.getElementById("cl-top-page-url").value); document.body.appendChild(script); } /********************************* ** コールバック ** tweet-content ** tweet-hash-tag **********************************/ function callback(bitlyResponse) { var content = document.getElementById("tweet-content"); var hashTags = document.getElementById("tweet-hash-tag-all"); var content_value = ""; var hashTags_value = ""; if (content.value) { content_value = content.value; } if (hashTags.value) { hashTags = hashTags.value; } var url = "http://twitter.com/home/?status=" + encodeURIComponent( content_value + " " + bitlyResponse.results[document.getElementById("cl-top-page-url").value]['shortUrl'] + " " + hashTags + " " ); window.open(url, '_blank'); } /********************************* ** つぶやき一覧を表示 **********************************/ function viewTweet() { var hashTags = document.getElementById("tweet-hash-tag"); window.open("http://twitter.com/search?q=" + encodeURIComponent(hashTags.value) + "&src=typd", '_blank'); }