Skip to content

Instantly share code, notes, and snippets.

@gurdiga
Last active December 7, 2025 09:41
Show Gist options
  • Select an option

  • Save gurdiga/9513feec77c98bd4a1634e6788ff54b0 to your computer and use it in GitHub Desktop.

Select an option

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>
@barrydesborough-cmd
Copy link

Works great. I tried to adapt this for pages too, just replacing the string "post" to "page", and the prompt, but no joy. I don't know why.

At the moment, all I am doing is manually adding a link to the appropriate edit URL to each post and page. I just change the last full stop/period/dot to a link to the edit page.

If anyone can explain why the page script doesn't work, I'd appreciate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment