Skip to content

Instantly share code, notes, and snippets.

@pengwynn
Created August 6, 2015 02:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pengwynn/cdee90946233e954c75e to your computer and use it in GitHub Desktop.
Save pengwynn/cdee90946233e954c75e to your computer and use it in GitHub Desktop.
Hack to find the total count of a GitHub API listing
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