Last active
May 8, 2024 03:30
-
-
Save hkitago/67ed3a91c7941ab9a2c6b657bac692cb to your computer and use it in GitHub Desktop.
Bookmarklet to create a new post for X with a text selected and the URL.
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
javascript:(()=>{w=window,d=document,t=(w.getSelection?w.getSelection():d.getSelection?d.getSelection():d.selection.createRange().text);if(!t||t==''){void(t=prompt('Create new XPost:',''));if(!t){t=d.title;}}else{t=`"${t}"`}if(t){w.open(`https://x.com/intent/tweet?text=${encodeURIComponent(t+' '+location.href)}`)}})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment