diff options
author | Minteck <nekostarfan@gmail.com> | 2021-08-08 12:04:30 +0200 |
---|---|---|
committer | Minteck <nekostarfan@gmail.com> | 2021-08-08 12:04:30 +0200 |
commit | 95112b1eb06a4be531ded59563d53a63a8d614e8 (patch) | |
tree | fd3dc676227309c87a39feab9ca458985e327907 /includes/stats/apis.php | |
parent | 87303b0d3540037fb94efdde24dbaacb2880d6cb (diff) | |
download | main-95112b1eb06a4be531ded59563d53a63a8d614e8.tar.gz main-95112b1eb06a4be531ded59563d53a63a8d614e8.tar.bz2 main-95112b1eb06a4be531ded59563d53a63a8d614e8.zip |
Opening!
Diffstat (limited to 'includes/stats/apis.php')
-rw-r--r-- | includes/stats/apis.php | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/includes/stats/apis.php b/includes/stats/apis.php index 5e8d05b..060ba18 100644 --- a/includes/stats/apis.php +++ b/includes/stats/apis.php @@ -1,23 +1,23 @@ -<?php - -class API { - private $keys; - - public function __construct() { - $this->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; - } -} +<?php
+
+class API {
+ private $keys;
+
+ public function __construct() {
+ $this->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;
+ }
+}
|