From ef51db8ae2110eddf241cc359fc91f20d0df9a4f Mon Sep 17 00:00:00 2001 From: Karel Wintersky Date: Wed, 3 Aug 2022 20:11:30 +0300 Subject: [PATCH] 1.0.3 * [+] Release * [+] `getPageFullExport()` method --- interfaces/LongreadsInterface.php | 10 +++++++++- sources/Longreads.php | 10 +++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/interfaces/LongreadsInterface.php b/interfaces/LongreadsInterface.php index 5ea57f2..775ed31 100644 --- a/interfaces/LongreadsInterface.php +++ b/interfaces/LongreadsInterface.php @@ -9,6 +9,7 @@ use PDO; use Psr\Log\LoggerInterface; use RuntimeException as RuntimeExceptionAlias; +use stdClass; interface LongreadsInterface { @@ -119,7 +120,14 @@ public function itemToggleVisibility($id, $new_state = 'hide'); * */ public function fetchPagesList(): array; - + + /** + * Возвращает Json-decoded информацию о лонгриде + * + * @param $id + * @return stdClass + */ + public function getPageFullExport($id):stdClass; } # -eof- diff --git a/sources/Longreads.php b/sources/Longreads.php index 5f6f34e..832afbd 100644 --- a/sources/Longreads.php +++ b/sources/Longreads.php @@ -622,13 +622,7 @@ public function fetchPagesList():array return $pages_list; } - /* ================================== PRIVATE METHODS ============================ */ - - /** - * @param $id - * @return stdClass - */ - private function getPageFullExport($id) + public function getPageFullExport($id):stdClass { $http_request_query = [ 'publickey' => $this->api_options['public_key'], @@ -662,6 +656,8 @@ private function getPageFullExport($id) } } + /* ================================== PRIVATE METHODS ============================ */ + private function downloadFile($from, $to) { if ($this->option_download_client === 'curl' && class_exists('\Curl\Curl')) {