Skip to content
Advertisement

How can I pull the languages ​used by GitHub api users and their percentages into my html page?

my ui js class:

JavaScript

how can I print the languages ​​the user is using in their repo and the percentiles of the languages? (i printed the username, name, surname, and repo names I got from the user)

my github js class :

JavaScript

Advertisement

Answer

I added a new function in your github class and now you can get the language percentage using ${repo.languagesPercentage} in html. Note -> 1. This will be an array so you need to add a forEach or convert it into string using toString(). 2. It will increase the number of APIs call in case of large repos and it can be optimised by giving a button in html named fetch language %.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement