Skip to content

Instantly share code, notes, and snippets.

@jennybc
Created February 7, 2015 19:50
Show Gist options
  • Save jennybc/862a01dc9243118d83c9 to your computer and use it in GitHub Desktop.
Save jennybc/862a01dc9243118d83c9 to your computer and use it in GitHub Desktop.
Digest link header in paginated GitHub API request
@jennybc
Copy link
Author

jennybc commented Feb 7, 2015

Posted for @aronlindberg re: discussion over here cscheid/rgithub#30

@aronlindberg
Copy link

Thanks @jennybc! I was able to adapt this gist for my purposes: https://gist.github.com/aronlindberg/2a9e9802579b2d239655

I modified the original function to use as.data.frame() because dplyr::as_data_frame could not be found. I also made sure that it returns 0 instead of a message when there are no headers (necessary for my subsequent iteration function to work).

@jennybc
Copy link
Author

jennybc commented Feb 19, 2015

Excellent! I know you probably won't see this, @aronlinberg, because Gist comments don't trigger notifications, but I'll still reply in case you do: The dplyr::as_data_frame() thing is probably because I've installed from GitHub and you from CRAN (or GitHub, but not as recent).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment