コード例 #1
0
 /**
  * Поиск новостей
  * @param string $query
  * @param int $offset
  * @param int $count
  * @return \GFB\SocialClientBundle\Entity\Vkontakte\Post[]
  */
 public function newsFeedSearch($query = "", $offset = 0, $count = 200)
 {
     // https://api.vk.com/method/newsfeed.search?q=hello&offset=0&count=200
     $context = array("q" => $query, "offset" => $offset, "count" => $count);
     $response = parent::prepareRequest(self::METHOD_NEWSFEED_SEARCH, $context)->send();
     $data = $this->prepareResponse($response->getBody());
     $posts = $this->hydrator->getPosts($data);
     return $posts;
 }
コード例 #2
0
 /**
  * @param string $method
  * @param array $context
  * @return \Guzzle\Http\Message\RequestInterface
  */
 protected function prepareRequest($method, $context = array())
 {
     $context["client_id"] = $this->container->getParameter("gfb_social_client.instagram.client_id");
     $context["client_secret"] = $this->container->getParameter("gfb_social_client.instagram.client_secret");
     return parent::prepareRequest($method, $context);
 }