Example #1
0
 public function exec()
 {
     $client = $this->_communication->getClient();
     $client->setUri('http://instagr.am/api/v1/feed/user/' . $this->_parameters['pk'] . '/' . $this->_parameters['time']);
     $response = $client->request(Zend_Http_Client::GET);
     $body = $response->getBody();
     $this->getResponse()->setData(self::parseResponse(Instagram_Client_Marshaller::unmarshall($body)));
 }
Example #2
0
 public function exec()
 {
     $postdata = array('username' => $this->_parameters['username'], 'device_id' => $this->_parameters['device_id'], 'password' => $this->_parameters['password']);
     $client = $this->_communication->getClient();
     $client->setUri('http://instagr.am/api/v1/accounts/login/');
     $client->setHeaders(array('User-Agent' => 'Instagram 1.9.4 (iPhone; iPhone OS 4.0.1; de_AT)', 'Content-Type' => 'application/x-www-form-urlencoded; charset=utf-8', 'Accept-Encoding' => 'gzip'));
     $client->setParameterPost($postdata);
     $response = $client->request(Zend_Http_Client::POST);
     $success = Instagram_Client_Marshaller::unmarshall($response->getBody(), true);
     if ($success->status != 'ok') {
         $ex = new Instagram_Command_LoginFailedException($success->message);
         $ex->setResponse($response);
         throw $ex;
     }
     $this->getResponse()->setData($success);
 }