Word Count: Difference between revisions
Mightyfelix (talk | contribs) |
|||
Line 27: | Line 27: | ||
=== Google Chrome === |
=== Google Chrome === |
||
#[https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en TamperMonkey] First you'll need to install TamperMonkey from the Chrome store. |
|||
[http://userscripts-mirror.org/scripts/show/70234 Chrome Install] Just go here to install the Chrome version and click on the '''Install''' button (GreaseMonkey not needed) |
|||
#[http://userscripts-mirror.org/scripts/show/70234 WordCount] Then, you'll be able to install the word count extension from here. |
|||
=== Opera === |
=== Opera === |
Revision as of 05:45, 18 May 2020
LibriVox member peegee has written a script for web browsers which may make the BC's job of compiling word counts for the Magic Window a little easier.
How it Works
The script runs against the HTML ebooks on Project Gutenberg.
- you click the paragraph where you want to start the count,
- it asks you the target number of words,
- it quickly goes through every paragraph from that point onwards and counts the words and the running total
- it stops when it reaches the target, or the end of the chapter if before
- the page is temporarily changed to display the word counts right there at the end of each paragraph
- you can repeat this as many times as you like, each time you click a paragraph the temporary page changes are removed
Screenshots
Here are a few screenshots to illustrate the process:
-
The first prompt
-
Choose target number
-
The count displayed
Installing the Script
The method of installation depends on the browser (Firefox and Chrome may need to be re-started after installation, Opera does not):
Firefox
- Greasemonkey You will first need the GreaseMonkey add-on for Firefox which is available from this link.
- Firefox Install Once you have GreaseMonkey installed, go here and click on the Install button
Google Chrome
- TamperMonkey First you'll need to install TamperMonkey from the Chrome store.
- WordCount Then, you'll be able to install the word count extension from here.
Opera
- To enable User JavaScript, use Tools > Preferences > Advanced > Content > JavaScript options, and select the directory where you will put your User JavaScript files (probably best if its a new folder with nothing else in it).
- the script then go to the script
- click the Install button to get the script in a new tab in Opera.
- from the Opera menu click File > Save As to save it into the folder you chose in the first step (probably best to just keep the suggested file-name - whatever name you choose it MUST end in .user.js )
Limitations
The script only works on the Gutenberg online HTML books, not the text or zipped HTML, or other formats.
Support
If you have any problems installing or using this script you can either post a message in this forum thread or send a Private Message to peegee.
Other Alternatives
Script for Gutenberg Texts
This website script will count out the number of words in each chapter. Enter the Gutenberg project ID number, fill in additional information (how many chapters there are, how the chapter headers are written, etc) and it will return the chapter word counts and the first and last words in the chapter.
https://karikarito.com/wordcount
Web Browser Bookmarklet
Creating a new bookmark, with the code below, will count the words in a highlighted piece of text.
You can use Word Count for the bookmark name, and then put the code into the address box, in the details section.
javascript:(function(){var t;if (window.getSelection) t = window.getSelection();else if (document.selection) t = document.selection.createRange();if (t.text != undefined) t = t.text;if(!t || t == ""){ a = document.getElementsByTagName("textarea"); for(i=0; i<a.length; i++) { if(a[i].selectionStart != undefined && a[i].selectionStart != a[i].selectionEnd) { t = a[i].value.substring(a[i].selectionStart, a[i].selectionEnd); break; } }}if(!t || t == "")alert("please select some text");else alert("word count: " + t.toString().match(/(\S+)/g).length);})()
Microsoft Office Word
Microsoft Word, and probably other text document creation software, has built-in word counting software. Copy and paste your text into a blank page, Select All (or highlight the portion you are word counting), and go Review/Word Count.