kylereddoch/scriptable

[BUG] - Cannot get user data: data.data.categories is undefined

yunwuxx opened this issue · 1 comments

Describe the bug

Script cannot get user data correctly, data.data.categories is undefined.

To Reproduce

Steps to reproduce the behavior:

  1. Input username.
  2. Run the script.

Expected behavior

Get user data correctly.

Additional context

It seems that the Wakatime API https://wakatime.com/api/v1/users/${userName}/stats/ requires cookie to get access to complete data. Without cookie, only limited data can be accessed:

{
    "data": {
        "human_readable_range": "last week",
        "id": "xxx",
        "is_already_updating": false,
        "is_coding_activity_visible": false,
        "is_including_today": false,
        "is_other_usage_visible": false,
        "is_stuck": false,
        "is_up_to_date": true,
        "percent_calculated": 100,
        "range": "last_7_days",
        "status": "ok",
        "timeout": 15,
        "user_id": "xxx",
        "username": "xxx",
        "writes_only": false
    }
}

Ooops, it seems that I forgot to turn on Display code time publicly in my profile.