Skip to content

Instantly share code, notes, and snippets.

@makotoworld
Created February 10, 2012 08:41
Show Gist options
  • Save makotoworld/1787836 to your computer and use it in GitHub Desktop.
Save makotoworld/1787836 to your computer and use it in GitHub Desktop.
topsy
<html>
<head>
<meta charset="UTF-8" />
<title>js sample</title>
<script type="text/javascript" src="http://a.nzk.me/static/js/jquery-1.7.1.js"></script>
<script type="text/javascript">
$(document).ready(function ($) {
urls = new Array("http://mainichi.jp/select/seiji/news/20120209k0000m010072000c.html",
"http://www.asahi.com/digital/nikkanko/NKK201202100010.html",
"http://www.townnews.co.jp/0601/2012/02/10/134821.html",
"http://www.youtube.com/watch?v=90GPRVeemvA",
"http://mainichi.jp/area/okinawa/news/20120210rky00m040005000c.html",
"http://ryukyushimpo.jp/news/storyid-187299-storytopic-1.html",
"http://www.asahi.com/digital/nikkanko/NKK201202100010.html",
"http://www.townnews.co.jp/0601/2012/02/10/134821.html",
"http://www.townnews.co.jp/0405/2012/02/10/134718.html",
"http://www.townnews.co.jp/0405/2012/02/10/134588.html",
"http://www.youtube.com/watch?v=4x1o8DHteIE",
"http://www.youtube.com/watch?v=4k0WtyNqCvY",
"http://www.youtube.com/watch?v=90GPRVeemvA",
"http://www.youtube.com/watch?v=ntOiijaIy5o",
"http://www.youtube.com/watch?v=VmN9DFHM0Rk",
"http://www.youtube.com/watch?v=47So8k7rQSc"
);
// $("#btn_1").click(function(){
for ( i in urls){
var baseurl = urls[i];
function topsyCount(data) {
var count = data.response.all;
$("input").after("<p>" + data.request.parameters.url + " : " + data.response.all + "</p>");
}
$.getJSON('http://otter.topsy.com/stats.js?url=' + encodeURIComponent(baseurl) + '&callback=?', topsyCount);
}
// });
});
</script>
</head>
<body>
<input id="btn_1" type="button" value="データ取得" />
qmail
POP3
Likeランキング
Tweetランキング
Retweetランキング
PVランキング
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment