Skip to content

Instantly share code, notes, and snippets.

@aereal
Created August 15, 2012 12:16
Show Gist options
  • Save aereal/3359647 to your computer and use it in GitHub Desktop.
Save aereal/3359647 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
$('.hatena-module-category').find('a').each(function(){
var $self = $(this);
var text = $.trim($self.text());
var count = text.match(/\((\d+)\)$/)[1];
$self.attr('data-count', parseInt(count));
$self.text('');
var name = text.split(/\s+/)[0];
$('<img/>').attr('src', 'http://' + name + '.jpg.to').appendTo($self);
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment