Permalink
Browse files

Since the v3 API doesn't seem to paginate like it says it does, thing…

…s can be a lot simpler.
  • Loading branch information...
1 parent 9b8d645 commit 44e245173b3391378fae855eaeef568101f28a7b @mikelietz mikelietz committed Nov 14, 2011
Showing with 5 additions and 17 deletions.
  1. +5 −17 extras_repos.php
View
@@ -2,25 +2,13 @@
$api_endpoint = 'https://api.github.com/';
-$url = $api_endpoint . "orgs/habari-extras";
-
+$url = $api_endpoint . "orgs/habari-extras/repos";
$result = file_get_contents( $url );
+$repos = json_decode ( $result );
-$result = json_decode ( $result );
-
-if ( isset( $result->public_repos ) and $result->public_repos > 0 ) {
- $url = $api_endpoint . "orgs/habari-extras/repos";
-
-// $url .= "?per_page=100"; // this does not seem to actually be paginating currently, so this is unnecessary
-
- $result = file_get_contents( $url );
-
- $repos = json_decode ( $result );
-
- $count = 1;
- foreach( $repos as $repo ) {
- echo $count++ . ". {$repo->name}\n";
+$extras_repositories = array();
- }
+foreach( $repos as $repo ) {
+ $extras_repositories[] = $repo->name;
}
?>

0 comments on commit 44e2451

Please sign in to comment.