Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stars, watchers, subscribers confusion #37

Open
pdurbin opened this issue Mar 25, 2023 · 0 comments
Open

stars, watchers, subscribers confusion #37

pdurbin opened this issue Mar 25, 2023 · 0 comments

Comments

@pdurbin
Copy link
Member

pdurbin commented Mar 25, 2023

Confusingly, "stars" and "watchers" are always the same number:

stars	watchers	repo
1120	1120	https://github.com/cs50/libcs50
732	732	https://github.com/IQSS/dataverse

http://developer.github.com/changes/2012-9-5-watcher-api/ via https://github.com/orgs/community/discussions/24795 explains that if you want what the GitHub UI calls watchers you should use subscribers_count instead.

So we can get different numbers like this:

stars	watchers	repo
1120	138	https://github.com/cs50/libcs50
732	66	https://github.com/IQSS/dataverse

... with the following change:

$ git diff
diff --git a/parse.go b/parse.go
index 49b3fc2..8f35564 100644
--- a/parse.go
+++ b/parse.go
@@ -57,7 +57,7 @@ type Repo struct {
        OpenIssues int       `json:"open_issues_count"`
        Size       int       `json:"size"`
        Forks      int       `json:"forks_count"`
-       Watchers   int       `json:"watchers_count"`
+       Watchers   int       `json:"subscribers_count"`
        PushedAt   time.Time `json:"pushed_at"`
        CreatedAt  time.Time `json:"created_at"`
        Desc       string    `json:"description"`

However, is this a good idea? Old versions of the data will have the old meaning for "watchers" (same as stars) while new versions of the data will have a new meaning for "watchers" (subscribers). Perhaps we should introduce a new column called "subscribers" and drop the "watchers" column.

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

No branches or pull requests

1 participant