I’m writing a script that retrieve data from a provided GitHub (html) URL as :
https://github.com/shumatech (is an user page)
https://github.com/RocketChat (is an org page)
My problem is I can’t deduce the API endpoint to repos automatically because the url scheme depends on if it’s an org or an user ; respectively : https://api.github.com/users/shumatech/repos and https://api.github.com/orgs/RocketChat/repos
How would you suggest me to implement this ?