Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include_once 'HTTP/OAuth/Consumer.php';
- // get logged blip user
- public function getLoggedBlipUser() {
- $endpoint = self::$api_url . '/profile';
- $json = $this->request($endpoint);
- if ($this->statius > 300) {
- return 'nieznany';
- } else return $json->login;
- }
- private function request($endpoint) {
- try {
- $response = $this->consumer->sendRequest($endpoint, array(), $this->method);
- $reply = json_decode($response->getBody());
- $this->status = $response->getStatus();
- $this->phrase = $response->getReasonPhrase();
- return $reply;
- } catch (HTTP_OAuth_Consumer_Exception_InvalidResponse $e) {
- echo $e->getBody();
- }
- }
Add Comment
Please, Sign In to add comment