niklashigi / devstats

:bar_chart: A CLI application that fetches stats from developer sites
https://asciinema.org/a/170671
MIT License
113 stars 9 forks source link

Add support for Code::Stats #6

Closed davialexandre closed 6 years ago

davialexandre commented 6 years ago

I've found about this project on asciicinema and I loved it!

Here's a little contribution that adds support to Code::Stats. This is how the stats look like with it:

2018-11-07-195032_429x147_scrot

The code is heavily based on the github one, but I decided to use their API instead of parsing the HTML output. This is my very first time coding in Typescript, so I hope I didn't do any mistake :crossed_fingers:

I'm not sure if there's any rule to decide which color to use for each account, so I simply picked the most dominant color from the Code::Stats site. Please let me know if you would prefer some other choice.

niklashigi commented 6 years ago

Thanks for your contribution, Davi! I'm happy to hear that you like devstats. :smiley:

but I decided to use their API instead of parsing the HTML output

You did the right thing. The only reason I use HTML parsing for GitHub is that there isn't an API to get contribution stats. All other Account's use APIs.

I simply picked the most dominant color from the Code::Stats site

I did the same thing for some of the other Account's because not all sites have a clearly identifiable and suitable (enough contrast to typical terminal background colors) brand color.

Again, thanks for contributing! I will release a new minor version including your contribution soon.

Nicd commented 6 years ago

Thanks @davialexandre for helping the C::S project. <3 Hope to get the GraphQL API public some day, for better stats.