@@ 215-223 (lines=9) @@ | ||
212 | * @param string $bookID |
|
213 | * @return string |
|
214 | */ |
|
215 | private function fetchDiscussions($bookID) { |
|
216 | $urlDiscussions = $this->paperhive_base_url . $this->paperhive_api_url . $bookID . $this->paperhive_discussion_api_endpoint; |
|
217 | try { |
|
218 | $response = $this->client->get($urlDiscussions, []); |
|
219 | } catch (\Exception $e) { |
|
220 | return false; |
|
221 | } |
|
222 | return $response->getBody(); |
|
223 | } |
|
224 | ||
225 | /** |
|
226 | * Does the call to PaperHive Documents API and returns the JSON for a book for specific BookID |
|
@@ 233-241 (lines=9) @@ | ||
230 | * @param string $bookID |
|
231 | * @return string/boolean |
|
232 | */ |
|
233 | private function fetchDocument($bookID) { |
|
234 | $urlDocument = $this->paperhive_base_url . $this->paperhive_api_url . $bookID; |
|
235 | try { |
|
236 | $response = $this->client->get($urlDocument, []); |
|
237 | } catch (\Exception $e) { |
|
238 | return false; |
|
239 | } |
|
240 | return $response->getBody(); |
|
241 | } |
|
242 | ||
243 | /** |
|
244 | * Gets the information about the book for specific BookID and saves as a file in requested directory |