Skip to content

Instantly share code, notes, and snippets.

@caseywatts
Last active April 1, 2023 01:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caseywatts/be0674debcfe35ee26bcc6d4a64f0f3d to your computer and use it in GitHub Desktop.
Save caseywatts/be0674debcfe35ee26bcc6d4a64f0f3d to your computer and use it in GitHub Desktop.
Toot to Twitter Bookmarklet
javascript: (function () {
const tootContents = encodeURIComponent(
document
.getElementsByClassName("detailed-status")[0]
.getElementsByClassName("status__content__text")[0].innerText
);
const twitterLink = `https://twitter.com/intent/tweet?text=${tootContents}`;
window.location.href = twitterLink;
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment