diff --git a/Readeck/Readeck.php b/Readeck/Readeck.php new file mode 100644 index 0000000000..79b89da93d --- /dev/null +++ b/Readeck/Readeck.php @@ -0,0 +1,61 @@ +jar = new \GuzzleHttp\Cookie\CookieJar; // Uncomment if cookies need to be set + } + + public function test() + { + $test = parent::appTest($this->url("api/contacts")); + echo $test->status; + } + + public function livestats() + { + $status = 'inactive'; + $res = parent::execute( + $this->url('api/bookmarks?is_archived=false'), + $this->attrs() + ); + + $details = json_decode($res->getBody()); + + $data = []; + + if ($details) { + $status = 'active'; + $data["bookmarks_count"] = count($details); + } + + return parent::getLiveStats($status, $data); + } + + public function url($endpoint) + { + $api_url = parent::normaliseurl($this->config->url) . $endpoint; + return $api_url; + } + + public function attrs() + { + $apikey = $this->config->apikey; + $attrs = [ + "headers" => [ + "content-type" => "application/json", + "Authorization" => "Bearer " . $apikey, + ], + ]; + return $attrs; + } +} diff --git a/Readeck/app.json b/Readeck/app.json new file mode 100644 index 0000000000..390c1b09ef --- /dev/null +++ b/Readeck/app.json @@ -0,0 +1,10 @@ +{ + "appid": "9ebfa3a7bc09302c2d7c55713d121bf073c9cc63", + "name": "Readeck", + "website": "https://readeck.org/", + "license": "GNU Affero General Public License v3.0", + "description": "Readeck is a simple web application that lets you save the precious readable content of web pages you like and want to keep forever.\r\nSee it as a bookmark manager and a read later tool.", + "enhanced": true, + "tile_background": "dark", + "icon": "readeck.png" +} \ No newline at end of file diff --git a/Readeck/config.blade.php b/Readeck/config.blade.php new file mode 100644 index 0000000000..a5710954d2 --- /dev/null +++ b/Readeck/config.blade.php @@ -0,0 +1,15 @@ +