# Getting data for the widget

**URL:** <https://meta.discourse.org/t/getting-data-for-the-widget/95632>\
**Category:** Development\
**Created:** [August 25, 2018, 4:26pm UTC](https://meta.discourse.org/t/getting-data-for-the-widget/95632 "2018-08-25T16:26:08Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Stranik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stranik/32/85638_2.png) [@Stranik](https://meta.discourse.org/u/Stranik)\
**Post date:** [August 25, 2018, 4:26pm UTC](https://meta.discourse.org/t/getting-data-for-the-widget/95632/1 "2018-08-25T16:26:09Z")

</div>

I don’t want to use this approach in widgets:

```plaintext
$.ajax({
  url: "/u/"+ username +".json", 
  dataType: 'json',
  async: false,
  success: function(data) {
	
  ....data.user.time_read;

```

Is there any other way to get this variable: `time_read`? This is an example.

from the template

`discourse/app/assets/javascripts/discourse/templates/discovery.hbs`

through

```plaintext
{{plugin-outlet name="discovery-list-container-top"
                        args=(hash category=category listLoading=loading)}}

```

no data is transmitted.

Is there any other way (other than json) to get this data (time\_read, badge\_count etc.)

_Extras._ `currentUser` does not have this data.

Thank

---

_[View the full topic](https://meta.discourse.org/t/getting-data-for-the-widget/95632)._
