public function getLikes() { $utility = new Utility(); $url = 'https://api.instagram.com/v1/users/self/media/liked?access_token=' . $this->accessToken; $response = $utility->fetchUrlAndJsonDecode($url); printR($response); return $response; }
public function fetchData($url) { require_once 'vendor/yelp/OAuth.php'; // Token object built using the OAuth library $token = new \Yelp\OAuthToken($this->token, $this->token_secret); // Consumer object built using the OAuth library $consumer = new \Yelp\OAuthConsumer($this->consumer_key, $this->consumer_secret); // Yelp uses HMAC SHA1 encoding $signature_method = new \Yelp\OAuthSignatureMethod_HMAC_SHA1(); // Build OAuth Request using the OAuth PHP library. Uses the consumer and token object created above. $oauthrequest = \Yelp\OAuthRequest::from_consumer_and_token($consumer, $token, 'GET', $url); // Sign the request $oauthrequest->sign_request($signature_method, $consumer, $token); // Get the signed URL $signed_url = $oauthrequest->to_url(); $utility = new Utility(); return $utility->fetchUrlAndJsonDecode($signed_url); }