EvanLi / Github-Ranking

:star:Github Ranking:star: Github stars and forks ranking list. Github Top100 stars list of different languages. Automatically update daily. | Github仓库排名,每日自动更新

Home Page:https://evanli.github.io/Github-Ranking

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some repos may be not included in top stars by mistake

Giancarlo-Ma opened this issue · comments

So many projects are ignored

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

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

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.

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!