-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
GitHub-API.php
28 lines (25 loc) · 967 Bytes
/
GitHub-API.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
error_reporting(0);
header("content-type: application/json; charset= UTF-8");
define("API", "https://api.ineo-team.ir");
define('ACCESS_KEY', "YOUR_ACCESS_KEY"); # Get from: T.me/APIManager_Bot?start=api-github
function GitHub($action, $data = []){
$data['accessKey'] = ACCESS_KEY;
$data['action'] = $action;
$cURL = curl_init();
curl_setopt($cURL, CURLOPT_URL, API."/github.php");
curl_setopt($cURL, CURLOPT_POST, true);
curl_setopt($cURL, CURLOPT_POSTFIELDS, $data);
curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);
$Result = curl_exec($cURL);
curl_close($cURL);
return $Result;
}
# Get GitHub Profile Information:
echo GitHub("profile", ['username' => "iNeoTeam"]);
# Get GitHub Page Repositories:
echo GitHub("repositories", ['username' => "iNeoTeam"]);
# Get GitHub Repositorie Information:
echo GitHub("project", ['url' => "https://github.com/iNeoTeam/GitHub-API"]);
unlink("error_log");
?>