あるURLを含むツイート数をカウントするAPIを叩く GeckoTang Follow 2011-08-26 13:54:51 License: MIT License Fork1 Fav3 View6237 Play Stop Reload Fullscreen Smart Phone Fork tree Readme JavaScript 13 lines HTML 11 lines CSS 4 lines あるURLを含むツイート数をカウントするAPIを叩く jQuery v1.4.2 $(function(){ window.countTweet = function(j){ $('#TweetCount').text(j.count); }; $('#TweetURLSubmit').click(function(){ var url = $('#TweetURL').val(); if(url){ $.getScript('http://urls.api.twitter.com/1/urls/count.json?url='+url+'&callback=countTweet'); } }); }); <form> <dl> <dt>ツイート数を調べたいURLを入力</dt> <dd> <input id="TweetURL" type="text" value="http://jsdo.it/"/> <input id="TweetURLSubmit" type="button" value="調べる"/> </dd> <dd>reTweetCount:<b id="TweetCount"></b></dd> </dl> </form> あるURLを含むツイート数をカウントするAPIを叩く YUI 3 CSS Reset body{ padding:10px; line-height:1.5; } $(function(){ window.countTweet = function(j){ $('#TweetCount').text(j.count); }; $('#TweetURLSubmit').click(function(){ var url = $('#TweetURL').val(); if(url){ $.getScript('http://urls.api.twitter.com/1/urls/count.json?url='+url+'&callback=countTweet'); } }); }); <form> <dl> <dt>ツイート数を調べたいURLを入力</dt> <dd> <input id="TweetURL" type="text" value="http://jsdo.it/"/> <input id="TweetURLSubmit" type="button" value="調べる"/> </dd> <dd>reTweetCount:<b id="TweetCount"></b></dd> </dl> </form> body{ padding:10px; line-height:1.5; } use an iframe compat browser, deer Tweet QR code Embed Design view Code view <script type="text/javascript" src="http://jsdo.it/blogparts/8Zp8/js?view=design"></script><p class="ttlBpJsdoit" style="width: 465px; margin: 0; text-align: right; font-size: 11px;"><a href="http://jsdo.it/GeckoTang/8Zp8" title="あるURLを含むツイート数をカウントするAPIを叩く">あるURLを含むツイート数をカウントするAPIを叩く - jsdo.it - share JavaScript, HTML5 and CSS</a></p> zip tags count.json twitter Tweet twitter Tags count.json twitter Favorite by Shinya.Murak.. gryng02 fingaholic Forked sort new page view favorite forked forked: あるURLを含むツイート数をカウントするAP.. Shinya.Murak.. 01 68views 14/11/4 count.json twitter forked from: あるURLを含むツイート数をカウン.. tooto93 00 429views 14/11/11