The Reading Time module adds a field that can be added to any content type that contains a body field. The Reading Time field calculates the estimated reading time for the content contained in the node's body field and displays it. You have likely seen this functionality on sites like Medium.

Including an estimated reading time provides a better user experience for sites that make use of longform writing, as people visiting your site will have a more objective idea of how long it will take them to read the page's content. This should result in an improvement in user retention on your site.

See http://briancray.com/posts/estimated-reading-time-web-design/ for a discussion of the benefits of displaying reading time to your site visitors.

Sandbox:
https://www.drupal.org/sandbox/staticred/2294205

Version control:
git clone --branch 7.x-1.x git.drupal.org:sandbox/staticred/2294205.git reading_time

Comments

staticred’s picture

Issue summary: View changes
PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxstaticred2294205git

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

acausing’s picture

To make a great project page.

Please take a look and pin-down all issues here: http://pareview.sh/pareview/httpgitdrupalorgsandboxstaticred2294205git

  1. You still have a master branch and no specific version branch, please take a looking moving from master branch
  2. There is NO README.txt, Please take a moment to make your README.txt follow the guidelines for in-project documentation and the README.txt Template.
  3. Your git address is not in a correct format, kindly use a full git clone syntax to pull your sandbox so it's easy for reviewer to copy-paste to pull your repository, but making sure to apply item number 1 first.
gisle’s picture

The function _calculate_reading_time computes "reading time" according to some formula that assumes that people read 200 words per minute. The formula is expressed as $minutes = floor($word / (200 / 60) / 60); where $word is the node's word count. Why not $minutes = floor($word / 200);?

Where does the formulate come from, and why is this the "right" way to compute reading time?

I must admit that I don't see the utility of this module. People read at different speeds, some words are short and simple, and some long and complex and the formula used to compute "reading time" obviously assumes that one size fits all. As it stands, I don't see how this can be useful, and that it may be better suited to live on as a special interest experimental project in the sandbox area (but I would like to hear other reviewers views on this). IMHO, most people should get a better estimate of reading time by just looking at the length and the difficulty level, and do an estimate based upon their personal experiences.

Given that there already exists projects like RickRoll in the Drupal namespace, I don't think being somewhat useless is a blocking issue, but it needs at least to have a good project page. The project page should maks the limitations clear to prospective users. The project page need to explain how "reading time" is computed and describe why this useful, the target audience, and some use cases for this.

About Drupal API usage:The function _calculate_reading_time computes reading time in minutes, with a resolution of ¼ minute. There is a Drupal function: format_interval that formats durations, but it is not capable of outputting fractions, so in this case, I think bypassing the Drupal API is OK.

staticred’s picture

Thanks for the comments!

Acausing:
Thanks - I thought I had already branched and added the README.txt, etc. I'll double-check the git link and edit the description.

Gisle:
200 wpm as an average reading speed is fairly well supported in academic literature - see Ziefle, M. (1998), Effects of display resolution on visual performance, Human Factors, 40(4), 555–568 for an example. Yes, it's an assumption, but it's a relatively well-supported one. There is some interpretation, yes, but it's a good general guideline for someone approaching an article.

From a usability/user experience standpoint, knowing the amount of time an article will take to read may help a user make the decision whether to read it now, bookmark it, or abandon the article entirely. What might look. at first glance, like a large article may in fact only be a 3 minute read. This is much more useful than just presenting the user with what appears to be a wall of text and hoping they keep reading, and may keep them active on your site for longer.

See http://www.nngroup.com/articles/measuring-the-usability-of-reading-on-th... for more discussion.

staticred’s picture

Issue summary: View changes
gisle’s picture

You have a README.txt, but it is in 7.x-1.x branch. @acausing complains about master being the default, so the 7.x-1.x branch was not visible to him at the time.

Just to avoid misunderstanding: It is what you put on your project page and README.txt that counts as documentation. You present a good argument for the project in #5 above, but there is none of it on your project page or README.txt yet.

staticred’s picture

Thanks gisle,

I've updated the default branch to 7.x-1.x (missed that option in the settings page before) and will update the README.txt and project description, adding in the paragraph above.

There's a few stylistic changes to make that the Coder module's code review didn't pick up on. When those are addressed, I'll change the status back to Needs review.

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.

staticred’s picture

Issue summary: View changes
Status: Closed (won't fix) » Needs review

Resubmitting for review.

tolstoydotcom’s picture

* in readingtime_field_widget_info change 'behaviours' to 'behaviors'

* some of the comments in the module file are still from the field example module. I'd suggest customizing those comments for this module.

* it would be preferable to provide a settings form so the site can have some control over the computation. For instance, for sites designed for language learners.

There might be other ways to do this other than as a field, but overall there don't seem to be major problems.

staticred’s picture

Thanks TolstoyDotCom

> * it would be preferable to provide a settings form so the site can
> have some control over the computation. For instance, for sites
> designed for language learners.

Feel free to add it as an enhancement request, and I'll add it to the next version.

staticred’s picture

Fixed #1 and #2 in comment #11.

staticred’s picture

TolstoyDotCom - I created the feature request for the settings form here: https://www.drupal.org/node/2472467

joachim’s picture

> description = "This module calculates the reading time for a node, and displays it as a field."

This description is shown on the admin list of of modules, so you don't need to say 'This module'.

> files[] = readingtime.module

Only files containing classes need to be declared.

> * We need to tell Drupal that we have two different types of formatters
* for this field. One will change the text color, and the other will
* change the background color.

Really?

> 'field_readingtime' => array(

You don't need to prefix a field type name with 'field_'.

> * We provide one of three different forms, depending on the widget type of
* the Form API item provided.

?

> * Returns reading time in minutes.

The word 'returns' is not needed. This should say something like 'The calculated reading time of the text, in minutes'.

> '#value' => $reading_estimate . ' ' . t('minutes to read.'),

You're using t() incorrectly here -- the value should be inserted using a placeholder.

> $columns = array(
'readingtime' => array('type' => 'int', 'length' => 1, 'not null' => FALSE),
);

It looks like your field is storing a boolean. And every uncached page view will cause the number to be recalculated. You might want to consider storing the calculated reading time instead, to improve performance.

staticred’s picture

Thanks Joachim - changes made based on your feedback. I've added a feature request to store the reading time - feel free to subscribe and contribute a patch!

Issue: https://www.drupal.org/node/2475351

sanket1007’s picture

I really liked this idea where you can decide whether to read the article now or bookmark it for later reading by looking at the reading time,
I tried your module with my blog page where i am using the field reading_time after body field.Despite i check the checkbox "display the reading time" , there is no time being displayed and also no data is getting saved into the database.

immoreel’s picture

staticred’s picture

Thanks Sanket. I'll check out why it isn't working for you.

The module doesn't save the reading time to the DB, but I have a feature request for post-release to consider adding that in.

staticred’s picture

Immoreal - looks like Brian took down his blog. I'll update the docs.

ayesh’s picture

About the post-release features:I'd be skeptic about this. Usually, modules that are complete, with a unique task that it can accomplish out of the box is easier to review.

I'm not saying one shouldn't make changes after an initial release, but calculating the time in real time vs storing them in the database are two different strategies. It's completely find for modules to involve, but postponing key points of a project makes other reviewers hesitant to write a solid review.

staticred’s picture

Ayesh - I've logged it as a feature request, rather than a confirmed new feature. This way, I can track the request and consider it after release as n alternate strategy.

As you say, it's a different method of providing the data. I feel the current method of calculating in the fly is fine, but I don't want to ignore the fact that two separate people have made that request.

However, I don't want to bog down the approval process with unnecessary changes that, at the end of the day, are a preference.

gobinathm’s picture

Status: Needs review » Needs work

@staticred can you also explain how this module is different from Integrate (https://www.drupal.org/project/integrate)...

ayesh’s picture

@gobinathm: Integrate module name isn't obvious that it provides read time estimation, so I believe OP wasn't aware of this module. Nor did I.
Also, that module has no releases, and doesn't seem to be maintained.

gobinathm’s picture

i does have a release just that it does not have a recommended release.. also during the submission of this application i believe the module did had recommended release (there are 40 downloads)

https://www.drupal.org/node/2220133/release

also when multiple feature is bundled in one module... its going to be impossible to get a name that will reflect all the function which can be handled by the module

staticred’s picture

Like Ayesh mentioned, I wasn't aware of the module (despite doing a search for the reading time functionality). It looks like it was developed at around the same time and offers similar, but not identical functionality.

staticred’s picture

Status: Needs work » Needs review

Changing back to Needs Review - goblinathm didn't supply any reason for changing it back to Needs Work, and I'm not sure why he did so.

staticred’s picture

Status: Needs review » Needs work

In response to comment #19, further testing has determined that the field isn't appearing in most circumstances. Setting back to Needs Work so I can spend some time addressing this.

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.