Skip to content

Instantly share code, notes, and snippets.

@fukamachi
Last active December 20, 2015 16:38
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fukamachi/6162605 to your computer and use it in GitHub Desktop.
Save fukamachi/6162605 to your computer and use it in GitHub Desktop.
はてなグループで本文のはてな記法をコピーするdotjs
$(function() {
$('.section h3').each(function() {
var entry = $(this);
var permalink = entry.find('a').first().attr('href');
$.get(permalink + '?mode=json').success(function(data) {
var button = $('<button>').text('コピー');
button.on('click', function() {
window.prompt("Copy to clipboard: Ctrl+C, Enter", data['body']);
});
entry.append(button);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment