Created
June 18, 2009 14:50
-
-
Save MSeven/131933 to your computer and use it in GitHub Desktop.
This file contains 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
<?php | |
private function query($method, $authorized = false) { | |
if ($authorized) { | |
$context = stream_context_create(array( | |
'http' => array( | |
'method' => 'POST', | |
'header' => sprintf("Content-type: application/x-www-form-urlencoded\r\n"), | |
'content' => http_build_query(array( | |
'login' => $this->username, | |
'token' => $this->token | |
)), | |
'timeout' => 5 | |
) | |
)); | |
} else { | |
$context = null; | |
} | |
return file_get_contents('http://github.com/api/v2/yaml/' . $method, false, $context); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment