FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
github_oauth/index.php at master · joeworkman/github_oauth · GitHub
joeworkman
/
github_oauth
Public
Notifications
You must be signed in to change notification settings
Fork
3
Star
12
Code
Issues
0
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
github_oauth
/
index.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
28 lines (21 loc) · 997 Bytes
Breadcrumbs
github_oauth
/
index.php
Copy path
File metadata and controls
28 lines (21 loc) · 997 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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>
Back
|
FazBrowse Home
|
New Git URL