Skip to content

Instantly share code, notes, and snippets.

@karmanyaahm
Created December 20, 2022 20:51
Show Gist options
  • Save karmanyaahm/33c4822131f6724f0570c4c3f52ad68f to your computer and use it in GitHub Desktop.
Save karmanyaahm/33c4822131f6724f0570c4c3f52ad68f to your computer and use it in GitHub Desktop.
Send currently selected text to you chosen ntfy topic by just clicking on a bookmarket; currently doesn't work for textboxes
javascript:(() => { w = window.open("https://ntfy.sh/mytopic/publish?message="+encodeURIComponent(document.getSelection().toString().replace(/(<br>)|(<br\/>)/, "\n"))); setTimeout(() => {w.close()}, 1500); })();
@nwithan8
Copy link

Awesome. Remember to add auth to the query parameters if you have any access control: https://docs.ntfy.sh/publish/#query-param

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