diff --git a/Linkding/Linkding.php b/Linkding/Linkding.php new file mode 100644 index 0000000000..fc6485fb55 --- /dev/null +++ b/Linkding/Linkding.php @@ -0,0 +1,49 @@ +url('api/bookmarks?limit=1'), $this->getHeaders()); + echo $test->status; + } + + public function livestats() + { + $status = 'inactive'; + $res = parent::execute($this->url('api/bookmarks?limit=1000'), $this->getHeaders()); + $details = json_decode($res->getBody()); + + $data = []; + if ($details) { + $status = 'active'; + $data = [ + "bookmark_count" => $details->count, + ]; + } + + return parent::getLiveStats($status, $data); + } + + public function url($endpoint) + { + $api_url = parent::normaliseurl($this->config->url) . $endpoint; + return $api_url; + } + + private function getHeaders() + { + return [ + "headers" => [ + "Authorization" => "Token " . $this->config->access_token, + ], + ]; + } +} diff --git a/Linkding/app.json b/Linkding/app.json new file mode 100644 index 0000000000..0d0e49cc78 --- /dev/null +++ b/Linkding/app.json @@ -0,0 +1,10 @@ +{ + "appid": "1a039cf9812aee2944f3e2c472288fab189bc1a9", + "name": "Linkding", + "website": "https://linkding.link/", + "license": "MIT License", + "description": "A self-hosted bookmark manager designed to be minimal, fast, and easy to set up.", + "enhanced": true, + "tile_background": "dark", + "icon": "linkding.png" +} \ No newline at end of file diff --git a/Linkding/config.blade.php b/Linkding/config.blade.php new file mode 100644 index 0000000000..dbf84ab082 --- /dev/null +++ b/Linkding/config.blade.php @@ -0,0 +1,15 @@ +