Skip to content

Instantly share code, notes, and snippets.

@lornajane
Created May 2, 2013 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lornajane/5502329 to your computer and use it in GitHub Desktop.
Save lornajane/5502329 to your computer and use it in GitHub Desktop.
Get a list of my gists with PHP streams
<?php
ini_set('user_agent', "PHP"); // github requires this
$api = 'https://api.github.com';
$url = $api . '/users/lornajane/gists';
// make the request
$response = file_get_contents($url);
// check we got something back before decoding
if(false !== $response) {
$gists = json_decode($response, true);
} // otherwise something went wrong
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment