metacpan / metacpan-api

A free, open API for everything you want to know about CPAN
http://www.metacpan.org/
Other
289 stars 196 forks source link

Add GitHub stars to /distribution #1293

Open oalders opened 8 hours ago

oalders commented 8 hours ago

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.

haarg commented 8 hours ago

The graphql for this:

query {
    repository(owner: %s, name: %s) {
        stargazerCount: stargazerCount
        watchers: watchers {
            totalCount
        }
    }
}

Could be added to the tickets script rather easily.

mickeyn commented 8 hours ago

We should be able to add it to the GitHub GraphQL query if it supports this info.