Last active
September 14, 2023 20:31
-
-
Save jpluimers/25ccce8136776db3f65e613c56e625ad to your computer and use it in GitHub Desktop.
Scripts for "Some JavaScript bookmarklets for WordPress published pages centered around navigation and IDs" https://wiert.me/2023/07/20/some-javascript-bookmarklets-for-wordpress-published-pages-centered-around-navigation-and-ids/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.getElementsByName("comment_post_ID")[0]?.value | |
// 85080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HighlanderComments.homeURL // as of 20230914 this does not work any more as HighlanderComments got removed | |
// Find this HTML element in stead and take the href: | |
// <link rel='openid.delegate' href='https://wiert.me/' /> | |
document.querySelector('link[rel="openid.delegate"]').href | |
// 'https://wiert.me/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// {var a=document.createElement("a"); a.setAttribute("href", HighlanderComments.connectURL); a.pathname=''; a.search=''; a.hash=''; a.href; } // as of 20230914 this does not work any more as HighlanderComments got removed | |
// Find the below HTML element in stead, then strip the "xmlrpc.php?rsd" from the end by removing the "pathname" and "search" bits | |
// <link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://wiert.wordpress.com/xmlrpc.php?rsd" /> | |
{var a=document.createElement("a"); a.setAttribute("href", document.querySelector('link[rel="EditURI"]').href); a.pathname=''; a.search=''; a.hash=''; a.href; } | |
// 'https://wiert.wordpress.com/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// {var a=document.createElement("a"); a.href=HighlanderComments.connectURL; a.pathname=''; a.search=''; a.hash=''; a.href; } // as of 20230914 this does not work any more as HighlanderComments got removed | |
// Find the below HTML element in stead, then strip the "xmlrpc.php?rsd" from the end by removing the "pathname" and "search" bits | |
// <link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://wiert.wordpress.com/xmlrpc.php?rsd" /> | |
{var a=document.createElement("a"); a.href=document.querySelector('link[rel="EditURI"]').href; a.pathname=''; a.search=''; a.hash=''; a.href; } | |
// 'https://wiert.wordpress.com/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// {var postID=document.getElementsByName("comment_post_ID")[0]?.value; a=document.createElement("a"); a.href=HighlanderComments.connectURL; a.pathname=''; a.search=`?p=${postID}`; a.hash=''; a.href; } // as of 20230914 this does not work any more as HighlanderComments got removed | |
// Find the below HTML element in stead, then strip the "xmlrpc.php?rsd" from the end by removing the "pathname" and "search" bits | |
// <link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://wiert.wordpress.com/xmlrpc.php?rsd" /> | |
{var postID=document.getElementsByName("comment_post_ID")[0]?.value; a=document.createElement("a"); a.href=document.querySelector('link[rel="EditURI"]').href; a.pathname=''; a.search=`?p=${postID}`; a.hash=''; a.href; } | |
// 'https://wiert.wordpress.com/?p=85080' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// {var postID=document.getElementsByName("comment_post_ID")[0]?.value; a=document.createElement("a"); a.href=HighlanderComments.connectURL; a.pathname='wp-admin/post.php'; a.search=`post=${postID}&action=edit&classic-editor`; a.hash=''; a.href; } // as of 20230914 this does not work any more as HighlanderComments got removed | |
// Find the below HTML element in stead, then strip the "xmlrpc.php?rsd" from the end by removing the "pathname" and "search" bits | |
// <link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://wiert.wordpress.com/xmlrpc.php?rsd" /> | |
{var postID=document.getElementsByName("comment_post_ID")[0]?.value; a=document.createElement("a"); a.href=document.querySelector('link[rel="EditURI"]').href; a.pathname='wp-admin/post.php'; a.search=`post=${postID}&action=edit&classic-editor`; a.hash=''; a.href; } | |
// 'https://wiert.wordpress.com/wp-admin/post.php?post=85080&action=edit&classic-editor' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.title | |
// 'Philosophy of management « The Wiert Corner – irregular stream of stuff' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelector('meta[property="og:title"]')?.content | |
// 'Philosophy of management' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelector('meta[name="application-name"]')?.content | |
// 'The Wiert Corner - irregular stream of stuff' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// {var postID=document.getElementsByName("comment_post_ID")[0]?.value; a=document.createElement("a"); a.href=HighlanderComments.connectURL; a.pathname=''; a.search=`?p=${postID}`; a.hash=''; a.text=document.title; a; } // as of 20230914 this does not work any more as HighlanderComments got removed | |
// Find the below HTML element in stead, then strip the "xmlrpc.php?rsd" from the end by removing the "pathname" and "search" bits | |
// <link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://wiert.wordpress.com/xmlrpc.php?rsd" /> | |
{var postID=document.getElementsByName("comment_post_ID")[0]?.value; a=document.createElement("a"); a.href=document.querySelector('link[rel="EditURI"]').href; a.pathname=''; a.search=`?p=${postID}`; a.hash=''; a.text=document.title; a; } | |
// <a href="https://wiert.wordpress.com/?p=85080">Philosophy of management « The Wiert Corner – irregular stream of stuff</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// {var postID=document.getElementsByName("comment_post_ID")[0]?.value; a=document.createElement("a"); a.href=HighlanderComments.connectURL; a.pathname=''; a.search=`?p=${postID}`; a.hash=''; a.target="blank"; a.rel="noopener"; a.text=document.querySelector('meta[property="og:title"]')?.content; a; } // as of 20230914 this does not work any more as HighlanderComments got removed | |
// Find the below HTML element in stead, then strip the "xmlrpc.php?rsd" from the end by removing the "pathname" and "search" bits | |
// <link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://wiert.wordpress.com/xmlrpc.php?rsd" /> | |
{var postID=document.getElementsByName("comment_post_ID")[0]?.value; a=document.createElement("a"); a.href=document.querySelector('link[rel="EditURI"]').href; a.pathname=''; a.search=`?p=${postID}`; a.hash=''; a.target="blank"; a.rel="noopener"; a.text=document.querySelector('meta[property="og:title"]')?.content; a; } | |
// <a href="https://wiert.wordpress.com/?p=85080" target="blank" rel="noopener">The Wiert Corner - irregular stream of stuff</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// {var postID=document.getElementsByName("comment_post_ID")[0]?.value; a=document.createElement("a"); a.href=HighlanderComments.connectURL; a.pathname=''; a.search=`?p=${postID}`; a.hash=''; a.target="blank"; a.rel="noopener"; a.text=document.querySelector('meta[property="og:title"]')?.content; prompt("Anchor", a.outerHTML); } // as of 20230914 this does not work any more as HighlanderComments got removed | |
// Find the below HTML element in stead, then strip the "xmlrpc.php?rsd" from the end by removing the "pathname" and "search" bits | |
// <link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://wiert.wordpress.com/xmlrpc.php?rsd" /> | |
{var postID=document.getElementsByName("comment_post_ID")[0]?.value; a=document.createElement("a"); a.href=document.querySelector('link[rel="EditURI"]').href; a.pathname=''; a.search=`?p=${postID}`; a.hash=''; a.target="blank"; a.rel="noopener"; a.text=document.querySelector('meta[property="og:title"]')?.content; prompt("Anchor", a.outerHTML); } | |
// A popup titled “wiert.me” with a prompt named “Anchor” where you can copy this HTML from: | |
// <a href="https://wiert.wordpress.com/?p=85080" target="blank" rel="noopener">Philosophy of management</a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment