Skip to content

Instantly share code, notes, and snippets.

@jasonseney
Last active January 8, 2021 20:52
Show Gist options
  • Save jasonseney/cdfd8981a903e54b35a9a5a0b3c141ab to your computer and use it in GitHub Desktop.
Save jasonseney/cdfd8981a903e54b35a9a5a0b3c141ab to your computer and use it in GitHub Desktop.
View Tumblr Post on the Dashboard
var blog = window.location.hostname.match(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9]+)\./)[1];
var postId = window.location.pathname.match(/\/(\d+)\/?/)[1];
window.location.href = `https://www.tumblr.com/blog/view/${blog}/${postId}`;
@jasonseney
Copy link
Author

jasonseney commented Jan 8, 2021

Bookmarklet Version

Copy → Paste this as the URL for a bookmark

javascript:(function()%7Bvar%20blog%20%3D%20window.location.hostname.match(%2F%5E(%5Ba-zA-Z0-9%5D%7C%5Ba-zA-Z0-9%5D%5Ba-zA-Z0-9%5C-%5D*%5Ba-zA-Z0-9%5D%2B)%5C.%2F)%5B1%5D%3Bvar%20postId%20%3D%20window.location.pathname.match(%2F%5C%2F(%5Cd%2B)%5C%2F%2F)%5B1%5D%3Bwindow.location.href%20%20%3D%20%60https%3A%2F%2Fwww.tumblr.com%2Fblog%2Fview%2F%24%7Bblog%7D%2F%24%7BpostId%7D%60%7D)()

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