Skip to content

Instantly share code, notes, and snippets.

@gurdiga
Last active September 19, 2021 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gurdiga/9513feec77c98bd4a1634e6788ff54b0 to your computer and use it in GitHub Desktop.
Save gurdiga/9513feec77c98bd4a1634e6788ff54b0 to your computer and use it in GitHub Desktop.
Quick-edit “Pencil” link for Blogspot.
<script>
var blogId = document.querySelector('link[rel="service.post"]').href.match(/\d+/)[0];
console.log('blogId', blogId);
setTimeout(function() {
document.querySelectorAll('.post-footer').forEach(function(footer) {
var postId = footer.parentElement.querySelector('a').name;
console.log('postId', postId);
var href = 'https://www.blogger.com/post-edit.g?blogID=' + blogId + '&postID=' + postId + '&from=pencil';
var a = document.createElement('a');
a.href = href;
a.textContent = 'Pencil';
footer.appendChild(a);
console.log('Added pencil', a);
});
}, 1000);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment