athul / waka-readme

Wakatime Weekly Metrics on your Profile Readme.
https://github.com/athul
MIT License
1.53k stars 301 forks source link

Option to include "other" languages in total time stat #80

Closed Eroxl closed 2 years ago

Eroxl commented 2 years ago

I would really appreciate the option to be able to include the other languages in my coding stats for my profile. It's not a large change in the times but I would like it to have all of my coding time included in it.

This should be pretty easy to implement by using human_readable_total_including_other_language instead of human_readable_total if the parameter is provided.

Not sure what a great name for the parameter is but something like this.

with:
          WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
          SHOW_TOTAL: true
          INCLUDE_OTHER_TIME_IN_TOTAL: true

I would like to implement this if it sounds all right.

yozachar commented 2 years ago

If you use more than 5 languages WakaTime puts them in a key called Other, which is displayed like...

Python     27 hrs 29 mins  ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣀⣀⣀⣀⣀   77.83 %
YAML       2 hrs 14 mins   ⣿⣦⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀   06.33 %
Markdown   1 hr 54 mins    ⣿⣤⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀   05.39 %
TOML       1 hr 48 mins    ⣿⣤⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀   05.11 %
Other      35 mins         ⣦⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀   01.68 %

Then there is an environment variable INPUT_SHOW_TOTAL that you can set to get the total time.

Total: 34 hrs 43 mins

I'm not sure I follow your doubt...

Eroxl commented 2 years ago

Sorry I think I worded it funny. Right now SHOW_TOTAL currently pulls from human_readable_total which doesn't include languages that Wakatime can't classify. I just want to add an option so you can chose to pull from human_readable_total_including_other_language see how I have around 6 hrs that Wakatime couldn't classify in the screen shot right now.

Screen Shot 2022-05-03 at 9 11 08 PM
yozachar commented 2 years ago

Is this API endpoint documented? Can't seem to find it here: https://wakatime.com/developers/

Neither is it visible anywhere in the official client code https://github.com/search?q=org%3Awakatime+human_readable_total_including_other_language

Eroxl commented 2 years ago

@joe733 I don't think it's documented but it's the same endpoint as right now just another field.

And neither is the field being used right now https://github.com/search?q=org%253Awakatime+human_readable_total&type=discussions

I'm not really sure how any of this is relevant? If you check the response from the current endpoint it responds with both fields even though neither are documented.

yozachar commented 2 years ago

Well human_readable_total is documented, or at least shown in examples, but human_readable_total_including_other_language is not. Apparently the latter shows up in GitHub code search results 571 times. That's pretty good usage count for an undocumented API field.

Anyway, I'll look into this.