アメブロにいいねボタンをつける

フリープラグインに以下を追加。

コード量が多いので、すでに色々追加している人は入らないかも・・・

<script>
$(document).ready(function(){
var page_url = location.href;
if (page_url.match(/^.+\/entrylist[\-0-9]*\.html$/g )) {
var entries = $(".newentrytitle a");
var classname = ".updatetime";
var flg = 0;
} else {
var entries = $(".foot a:contains('記事URL')");
var classname = "div.entry .theme";
var flg = 1;
}
for (i = 0; i < entries.length; i++) {
var url = entries[i];
if (flg == 0) {
title = entries.eq(i).text();
} else {
title = $("div.entry h3.title").eq(i).text();
}
var facebook_btn = '<iframe src="http://www.facebook.com/plugins/like.php?href=' + encodeURIComponent(url)+'&amp;layout=button_count&amp;show_faces=false&amp;width=450&amp;action=like&amp;font&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:21px;" allowTransparency="true"></iframe>';
$(classname).eq(i).append(' <span>' + facebook_btn + '</span>');
}
})
</script>

ネタ元