How can I get more than 100 results from GitHub API v3 using “github_api” gem?

后端 未结 3 440
失恋的感觉
失恋的感觉 2020-12-18 06:17

I\'m using GitHub API Gem and trying to get statistics about contributors\'s additions, deletions, and commit counts. The problem is that I get only 100 results and can\'t g

3条回答
  •  盖世英雄少女心
    2020-12-18 06:54

    I'm unsure what you mean by passing in the auto_pagination option since that seems to be something that's configured when creating a new GitHub instance, e.g.,

    github = GitHub.new do |config|
      config.auto_pagination = true
    end
    github.repos.contributors 'rails', 'rails'
    

    Frankly though, I would suggest using the official GitHub API gem -- octokit.rb. It does the pagination work for you and intelligently knows when it can bump the number of items per page to 100.

提交回复
热议问题