# Read time & badgers on custom pages

**URL:** https://meta.discourse.org/t/read-time-badgers-on-custom-pages/90933
**Category:** Development
**Created:** [June 28, 2018, 9:13am UTC](https://meta.discourse.org/t/read-time-badgers-on-custom-pages/90933 "2018-06-28T09:13:04Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Bas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bas/32/294929_2.png) [@Bas](https://meta.discourse.org/u/Bas)
#### Post date: [June 28, 2018, 9:13am UTC](https://meta.discourse.org/t/read-time-badgers-on-custom-pages/90933/1 "2018-06-28T09:13:04Z")

</div>

We are running some custom documentation pages at custom routes.  
I’d love to know how to hook into Discourse’s built-in read-time metrics on these pages. Ideally I’d like to solve this usecase:

> Grant a ‘Bookworm badge’ to anyone who has spent at least 4 hours reading pages under `/documentation`

Can anyone point us in the right direction?  
Thanks!

---

<div class="post-metadata">

### Author: ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)
#### Post date: [June 29, 2018, 12:03am UTC](https://meta.discourse.org/t/read-time-badgers-on-custom-pages/90933/2 "2018-06-29T00:03:11Z")

</div>

I can’t wait to see what the badger looks like!

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [June 29, 2018, 1:18am UTC](https://meta.discourse.org/t/read-time-badgers-on-custom-pages/90933/3 "2018-06-29T01:18:02Z")

</div>

> [@Bas](#):
>
> We are running some custom documentation pages at custom routes.

Do you know if entering the custom route adds an entry to the `post_timings` table? If so, you could get the read times from there.

---

<div class="post-metadata">

### Author: ![Bas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bas/32/294929_2.png) [@Bas](https://meta.discourse.org/u/Bas)
#### Post date: [June 29, 2018, 7:40am UTC](https://meta.discourse.org/t/read-time-badgers-on-custom-pages/90933/4 "2018-06-29T07:40:01Z")

</div>

> [@simon](#):
>
> Do you know if entering the custom route adds an entry to the `post_timings` table? If so, you could get the read times from there.

No, seems it only contains entries with a valid `topic_id`  
Perhaps we could extend this somehow, but that feels like adding even more logic.

This does raise an interesting question though.. does discourse not count reading things like the homepage / categories overview etc?

---

<div class="post-metadata">

### Author: ![Bas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bas/32/294929_2.png) [@Bas](https://meta.discourse.org/u/Bas)
#### Post date: [June 29, 2018, 7:40am UTC](https://meta.discourse.org/t/read-time-badgers-on-custom-pages/90933/5 "2018-06-29T07:40:26Z")

</div>

> [@HAWK](#):
>
> I can’t wait to see what the badger looks like!

Think I’ll keep this typo for now 😃

---

<div class="post-metadata">

### Author: ![cmwebdev](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cmwebdev/32/122368_2.png) [@cmwebdev](https://meta.discourse.org/u/cmwebdev)
#### Post date: [June 29, 2018, 7:24pm UTC](https://meta.discourse.org/t/read-time-badgers-on-custom-pages/90933/6 "2018-06-29T19:24:32Z")

</div>

![](https://global.discourse-cdn.com/meta/original/3X/e/a/ea5f446a6edee260db269264ce45f29aca91c10d.jpg)

---

<div class="post-metadata">

### Author: ![Bas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bas/32/294929_2.png) [@Bas](https://meta.discourse.org/u/Bas)
#### Post date: [July 4, 2018, 1:28pm UTC](https://meta.discourse.org/t/read-time-badgers-on-custom-pages/90933/7 "2018-07-04T13:28:38Z")

</div>

As far as I know, we can easily store things per user in the pluginstore, think that would be the most viable approach for this. Just a key-value pair with the static page’s slug and the total read time for this user.
