Return Pinterest API url for search requests.
public static getSearchUrl ( array $bookmarks = [] ) : string | ||
$bookmarks | array | |
리턴 | string |
/** * Executes search to API. Query - search string. * * @param string $query * @param string $scope * @param array $bookmarks * * @return SearchResponse */ public function searchCall($query, $scope, $bookmarks = []) { $url = UrlBuilder::getSearchUrl($bookmarks); $get = $this->createSearchQuery($query, $scope, $bookmarks); $result = $this->request->exec($url . '?' . $get); $this->processResult($result); return new SearchResponse($this->response); }
/** * Get recommendations for query word. * * @param $query * @return array|bool */ public function recommendedFor($query) { $requestOptions = ['scope' => 'pins', 'query' => $query]; $result = $this->execGetRequest($requestOptions, UrlBuilder::getSearchUrl()); return $this->getKeywordsFromRequest($result); }