o9s
is a microblog
home archives search feed blogroll


Readtime

On Medium, before reading an article, it tells you the estimated read time.

Read time is based on the average reading speed of an adult (roughly 275 WPM). We take the total word count of a post and translate it into minutes, with an adjustment made for images.”

Medium

function readtime(article) {
  return Math.ceil(article.length / 275) + " min read";
}

It’s missing the image adjustment. It still gives a pretty good estimate.

Posted on 2018-03-21   #javascript  






← Next post    ·    Previous post →