You are here

public function InstagramOAuth::get_request_token in Drupagram 7

Same name and namespace in other branches
  1. 6 drupagram.lib.php \InstagramOAuth::get_request_token()

Requests token. Not implemented with Instagram yet.

File

./drupagram.lib.php, line 477
Classes to implement the full Instagram API

Class

InstagramOAuth
A class to provide OAuth enabled access to the Instagram API

Code

public function get_request_token() {
  $url = $this
    ->create_url('oauth/request_token', '');
  try {
    $response = $this
      ->auth_request($url);
  } catch (InstagramException $e) {
  }
  parse_str($response, $token);
  $this->token = $token;
  $this->access_token = $token['access_token'];
  $this->auth_user = new InstagramUser($token['user']);
  return $token;
}