metacpan-api
metacpan-api copied to clipboard
Add GitHub stars to /distribution
We're already doing something like this for https://fastapi.metacpan.org/distribution/App-perlimports:
{
"name" : "App-perlimports",
"bugs" : {
"github" : {
"active" : 10,
"open" : 10,
"closed" : 105,
"source" : "https://github.com/perl-ide/App-perlimports"
}
},
"river" : {
"total" : 0,
"bucket" : 0,
"immediate" : 0,
"bus_factor" : 1
}
}
If we could add GitHub stars (and watchers?) to the this endpoint we could easily incorporate that into the front end without the extra GitHub requests. Hopefully that would encourage more people to star the repository in question.
The graphql for this:
query {
repository(owner: %s, name: %s) {
stargazerCount: stargazerCount
watchers: watchers {
totalCount
}
}
}
Could be added to the tickets script rather easily.
We should be able to add it to the GitHub GraphQL query if it supports this info.