From af9e5ef458b93ef2003905e1ccc5665e7266c242 Mon Sep 17 00:00:00 2001 From: Minteck <46352972+Minteck@users.noreply.github.com> Date: Tue, 20 Jul 2021 01:15:15 +0200 Subject: Commit --- includes/stats/apis.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 includes/stats/apis.php (limited to 'includes/stats/apis.php') diff --git a/includes/stats/apis.php b/includes/stats/apis.php new file mode 100644 index 0000000..5e8d05b --- /dev/null +++ b/includes/stats/apis.php @@ -0,0 +1,23 @@ +keys = json_decode(file_get_contents("./credentials.json"), true); + } + + public function GitHub(string $path) { + exec("curl -A \"Minteck-Space/0.0.0 (nekostarfan@gmail.com)\" -H \"Authorization: token " . $this->keys["github"] . "\" https://api.github.com/" . $path, $op); + $result = implode("\n", $op); + + return $result; + } + + public function Reddit(string $path) { + exec("curl -A \"Minteck-Space/0.0.0 (nekostarfan@gmail.com)\" https://www.reddit.com/" . $path . ".json", $op); + $result = implode("\n", $op); + + return $result; + } +} -- cgit