Github-Ranking icon indicating copy to clipboard operation
Github-Ranking copied to clipboard

Some repos may be not included in top stars by mistake

Open Giancarlo-Ma opened this issue 3 years ago • 5 comments

So many projects are ignored

Giancarlo-Ma avatar Apr 27 '21 00:04 Giancarlo-Ma

Now I use these three API to get most stars or forks repository:

Most stars:

https://api.github.com/search/repositories?q=stars:>0&sort=stars&per_page=100

Most forks:

https://api.github.com/search/repositories?q=forks:>0&sort=forks&per_page=100

Most language stars (e.g., Python):

https://api.github.com/search/repositories?q=language:Python&stars:>0&sort=stars&per_page=100

And freeCodeCamp is the most stars repo, datasharing is the most forks repo, system-design-primer is the most Python stars so far.

Sometimes these apis just not return right repos (some repos may be left out).

For example, now I get most Python stars repo is public-apis, but when I try again it maybe return right repos (maybe not).

You can try it by yourself to see this issue.

I don't know why this happens so far.

But I will try to fix this issue in the future and update here.

#3 #6 #8

EvanLi avatar May 06 '21 10:05 EvanLi

An example of this issue I found is https://github.com/sindresorhus/awesome

Wouterr0 avatar Jun 30 '21 12:06 Wouterr0

Since 2021-08-20 commit I have changed the query method from Github REST API v3 to Github GraphQL API v4. It seems like this issue doesn't reappear.

EvanLi avatar Aug 21 '21 07:08 EvanLi

Still there are many repos that are not listed in the list. A simple comparison between https://github.com/search?q=stars%3A%3E30000+language%3APython&type=Repositories&ref=advsearch&l=Python&l= and https://github.com/EvanLi/Github-Ranking/blob/master/Top100/Python.md

m-yosefpor avatar Feb 01 '23 12:02 m-yosefpor

I find that when I query the GraphQL API, sometimes it just returns the wrong results.

Here is an example, you can try it yourself on GraphQL API Explorer

query{
    search(query: "language:Python stars:>0 sort:stars", type: REPOSITORY, first:100) {
      pageInfo { endCursor }
        edges {
            node {
                ...on Repository {
                    id
                    name
                    url
                    forkCount
                    stargazers {
                        totalCount
                    }
                    owner {
                        login
                    }
                    description
                    pushedAt
                    primaryLanguage {
                        name
                    }
                    openIssues: issues(states: OPEN) {
                        totalCount
                    }
                }
            }
        }
    }
}

I tried three times, here are the results:

All three times have different data.

I don't know why this happened yet, and I have no idea how to fix it. If anyone finds the solution, please tell me. Thanks!

EvanLi avatar Feb 14 '23 08:02 EvanLi