Skip to content

Instantly share code, notes, and snippets.

@mvark
Created November 13, 2023 07:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mvark/97c32d3b8117d138d0858cf176cc4f1d to your computer and use it in GitHub Desktop.
Save mvark/97c32d3b8117d138d0858cf176cc4f1d to your computer and use it in GitHub Desktop.
Compact version of Bookmarklet code to calculate Word Count & Estimated Reading Time
javascript:(function(wpm = 200){const st = window.getSelection().toString().trim(),tw = st ? st.split(/\s+/).length : document.body.innerText.split(/\s+/).length,et = Math.ceil(tw / wpm);alert(`Word count: ${tw}\nEstimated reading time: ${et} minutes`);})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment