Skip to content

Commit

Permalink
1.0.3
Browse files Browse the repository at this point in the history
* [+] Release
* [+] `getPageFullExport()` method
  • Loading branch information
KarelWintersky committed Aug 3, 2022
1 parent 4b5df4f commit ef51db8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 9 additions & 1 deletion interfaces/LongreadsInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use PDO;
use Psr\Log\LoggerInterface;
use RuntimeException as RuntimeExceptionAlias;
use stdClass;

interface LongreadsInterface
{
Expand Down Expand Up @@ -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-
10 changes: 3 additions & 7 deletions sources/Longreads.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down Expand Up @@ -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')) {
Expand Down

0 comments on commit ef51db8

Please sign in to comment.