Last active
March 18, 2017 06:15
-
-
Save felquis/e547ef0db08df8c453608de7e5a45c7d to your computer and use it in GitHub Desktop.
Revisions
-
felquis revised this gist
Mar 18, 2017 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,10 +4,10 @@ document.body.innerText.split(' ') .map((split) => split.replace(/[^a-zZ-a]+/g, '')) .filter((split) => split.length > 1) .reduce((acc, split) => { const time = split.split('').length * 115 return [...acc, (time > 500) ? time : 500] }, []) .reduce((acc, time) => ([acc[0] + time]), [0]) .map((time) => (time / 1000 / 60)) // instead of using document.body, you can select only the main content of your page -
felquis created this gist
Mar 18, 2017 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ // output is in minutes document.body.innerText.split(' ') .filter((split) => split.length > 1) .map((split) => split.replace(/[^a-zZ-a]+/g, '')) .filter((split) => split.length > 1) .reduce((acc, split) => { const time = split.split('').length * 70 return [...acc, (time < 400) ? time : 400] }, []) .reduce((acc, time) => ([acc[0] + time]), [0]) .map((time) => time / 1000 / 60) // instead of using document.body, you can select only the main content of your page