Skip to content
This repository has been archived by the owner on Oct 21, 2020. It is now read-only.

feat: add GitHub used by metric #507

Open
DirtyF opened this issue May 26, 2019 · 13 comments
Open

feat: add GitHub used by metric #507

DirtyF opened this issue May 26, 2019 · 13 comments

Comments

@DirtyF
Copy link
Contributor

DirtyF commented May 26, 2019

GitHub introduced a new metric, which I find much more relevant than stars or downloads. It shows the number of times a dependency is used by other repositories.
It would be nice to have that metric added to Staticgen for static site generators distributed as a package.

Jekyll is uses 285228 times

Gatsby is used 73787 times

@erquhart
Copy link
Contributor

Yeah I'm in agreement 👍👍

@relhajj
Copy link

relhajj commented Jun 5, 2019

where can I find this metric ?

@erquhart
Copy link
Contributor

erquhart commented Jun 5, 2019

GitHub displays it on individual repos, check the top of ours for example. I assume it's available through their API as well.

Sent with GitHawk

@nticaric
Copy link

How is this metric added to a repository?

@douglasg14b
Copy link

I would also like to know how this metric is added to a repository.

@douglasg14b
Copy link

After some digging it seems that this metric is reliant on https://github.com/netlify/staticgen/network/dependents

Which in this case is none, at least according to github.

@erquhart
Copy link
Contributor

erquhart commented Jun 12, 2019

@nticaric GitHub shows package metrics for projects that use a package manager, eg. if your repo has a package.json, it will use that to show your dependency network.

@douglasg14b this issue isn't about the package metrics for the staticgen repo, it's about package metrics for the projects shown on the site.

Sent with GitHawk

@hansiemithun
Copy link

Is there an api that will provide used by information, stars information?

@erquhart
Copy link
Contributor

The data is in this gist, updated daily and keeps 60 days history: https://gist.github.com/netlify-bot/99f2094783ddb2025bd1033f666c34cc#file-staticgen-archive-json

Sent with GitHawk

@hansiemithun
Copy link

@erquhart If it was addressed to me, i am very sorry, not clear... please elaboarate. I can only see code, no api info

@erquhart
Copy link
Contributor

There is no API, the site uses the GitHub Gist API to fetch and update the JSON file in that Gist.

Sent with GitHawk

@hansiemithun
Copy link

Screenshot 2019-12-22 at 11 07 38 PM

As per this data, do we need to consider the array object which starts from second key ???

@erquhart
Copy link
Contributor

erquhart commented Dec 22, 2019

It’s an array arrays, each array has shape:

[
  timestamp, // timestamp from when this data was retrieved
  [
    {
      id, // unique identifier derived from filename 
      s, // repo stars
      fk, // repo forks
      i, // repo issues
      f, // Twitter followers
    },
    ...
  ],
]

Sent with GitHawk

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants