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
<? | |
//post url | |
$url = "https://api.github.com/users/octocat/repos"; | |
//set file_get_contents header info | |
$opts = [ | |
'http' => [ | |
'method' => 'GET', | |
'header' => [ |
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
<? | |
//personal auth token from your github.com account. doing this will eliminate having to use oauth everytime | |
$token = "zzzzzzzzYourPersonalGithubAccessTokenzzzzzzzz"; | |
//post url, https://developer.github.com/v3/issues/ | |
$url = "https://api.github.com/repos/octocat/some_repo/issues?access_token=" . $token; | |
//request details, removing slashes and sanitize content | |
$title = htmlspecialchars(stripslashes("Test Title''\s"), ENT_QUOTES); | |
$body = htmlspecialchars(stripslashes("Test Body'\'$%'s"), ENT_QUOTES); |