Created
February 1, 2022 08:42
-
-
Save aintai/bf1c8da96ab1c46be13b7ba89e8e1a9d to your computer and use it in GitHub Desktop.
tagcloud for Tumblr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
(function () { | |
var posts = new TumblrPosts({ | |
domain: "hoge.tumblr.com", | |
maxNum: 1000 //タグを取得する投稿数(記事数膨大なときの制限用) | |
}); | |
posts.bind(posts.EVENT_COMPLETE, function (e) { | |
var that = this; | |
var tagMaxNum = 50; //表示するタグ数の最大値 | |
$.each(this.getTags("desc"), function (i, tag) { | |
var html = '<li>' + '<a href="/tagged/' + tag.name + '">' + tag.name + ' (' + tag.count + ')</a></li>'; | |
if (i === tagMaxNum) {return false;} | |
$(html).appendTo($("ul#tags")); | |
}); | |
}); | |
posts.run(); | |
})(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment