-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.php
28 lines (21 loc) · 997 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
require_once('github_oauth.php');
$client_key = 'insert_api_client_id'; // Insert you Client ID from your registered GitHub API
$secret_key = 'insert_api_secret_key'; // Insert you Secret Key from your registered GitHub API
$scope = 'repo'; // Enter the scope that you want. Go to http://developer.github.com/v3/oauth for more info on scope.
// Create our OAuth object
$oauth = new GitHubOauth($scope, $client_key, $secret_key);
// If we already have an access token or the get parameter is specified to get a new one, get on.
// Else we need to authenticate the user.
($oauth->has_access_token() or isset($_GET['code'])) ? $oauth->get_access_token() : $oauth->get_user_authorization();
// Submit your request. See http://developer.github.com/v3 for more details on possible queries
$issues = $oauth->request("issues");
?>
<html>
<body>
<h1>My Github Issues</h1>
<ul>
<?php foreach($issues as $issue) { echo "<li>#$issue->number - $issue->title</li>"; } ?>
</ul>
</body>
</html>