Created
August 6, 2015 02:05
-
-
Save pengwynn/cdee90946233e954c75e to your computer and use it in GitHub Desktop.
Hack to find the total count of a GitHub API listing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'octokit' | |
Octokit.pulls("rails/rails", :state => "all", :per_page => 1) | |
last_page = Octokit.last_response.rels[:last].href | |
count = Addressable::URI.parse(last_page).query_values["page"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment