Ejemplo n.º 1
0
 function __construct()
 {
     parent::__construct();
     $this->place_types = array('unknown' => __('Unknown', 'keyring'), 'home' => __('Home', 'keyring'), 'work' => __('Work', 'keyring'), 'school' => __('School', 'keyring'), 'user' => __('Manually Named', 'keyring'), 'foursquare' => __('Selected from foursquare', 'keyring'));
     $this->activity_types = array('wlk' => __('Walking', 'keyring'), 'cyc' => __('Cycling', 'keyring'), 'run' => __('Running', 'keyring'), 'trp' => __('Transport', 'keyring'));
     // Enable "basic" UI for entering key/secret
     if (!KEYRING__HEADLESS_MODE) {
         add_action('keyring_moves_manage_ui', array($this, 'basic_ui'));
         add_filter('keyring_moves_basic_ui_intro', array($this, 'basic_ui_intro'));
     }
     $this->set_endpoint('authorize', 'https://api.moves-app.com/oauth/v1/authorize', 'GET');
     $this->set_endpoint('access_token', 'https://api.moves-app.com/oauth/v1/access_token', 'POST');
     $this->set_endpoint('verify_token', 'https://api.moves-app.com/oauth/v1/tokeninfo', 'GET');
     $this->set_endpoint('profile', 'https://api.moves-app.com/api/1.1/user/profile', 'GET');
     $creds = $this->get_credentials();
     $this->app_id = $creds['app_id'];
     $this->key = $creds['key'];
     $this->secret = $creds['secret'];
     $this->consumer = new OAuthConsumer($this->key, $this->secret, $this->callback_url);
     $this->signature_method = new OAuthSignatureMethod_HMAC_SHA1();
     // Moves requires an exact match on Redirect URI, which means we can't send any nonces
     $this->callback_url = remove_query_arg(array('nonce', 'kr_nonce'), $this->callback_url);
     add_action('pre_keyring_moves_verify', array($this, 'redirect_incoming_verify'));
     $this->authorization_header = 'Bearer';
     $this->authorization_parameter = false;
     add_filter('keyring_moves_request_token_params', array($this, 'request_token_params'));
 }
Ejemplo n.º 2
0
 function __construct()
 {
     parent::__construct();
     // Enable "basic" UI for entering key/secret
     if (!KEYRING__HEADLESS_MODE) {
         add_action('keyring_eventbrite_manage_ui', array($this, 'basic_ui'));
         add_filter('keyring_eventbrite_basic_ui_intro', array($this, 'basic_ui_intro'));
     }
     $creds = $this->get_credentials();
     $this->key = $creds['key'];
     $this->secret = $creds['secret'];
     $this->consumer = new OAuthConsumer($this->key, $this->secret, $this->callback_url);
     $this->signature_method = new OAuthSignatureMethod_HMAC_SHA1();
     $this->authorization_header = 'Bearer';
     // Oh, you
     $this->authorization_parameter = false;
     $this->set_endpoint('authorize', self::OAUTH_BASE . 'authorize', 'GET');
     $this->set_endpoint('access_token', self::OAUTH_BASE . 'token', 'POST');
     $this->set_endpoint('self', self::API_BASE . 'users/me/', 'GET');
 }
 function __construct()
 {
     parent::__construct();
     // Enable "basic" UI for entering key/secret
     if (!KEYRING__HEADLESS_MODE) {
         add_action('keyring_spotify_manage_ui', array($this, 'basic_ui'));
         add_filter('keyring_spotify_basic_ui_intro', array($this, 'basic_ui_intro'));
         add_filter('keyring_spotify_basic_ui_app_id', '__return_empty_string');
     }
     $this->set_endpoint('authorize', 'https://accounts.spotify.com/authorize', 'GET');
     $this->set_endpoint('access_token', 'https://accounts.spotify.com/api/token', 'POST');
     $this->set_endpoint('self', 'https://api.spotify.com/v1/me', 'GET');
     $creds = $this->get_credentials();
     $this->key = $creds['key'];
     $this->secret = $creds['secret'];
     $this->consumer = new OAuthConsumer($this->key, $this->secret, $this->callback_url);
     $this->signature_method = new OAuthSignatureMethod_HMAC_SHA1();
     $this->authorization_header = 'Bearer';
     $this->authorization_parameter = false;
 }
Ejemplo n.º 4
0
 function __construct()
 {
     parent::__construct();
     // Enable "basic" UI for entering key/secret
     if (!KEYRING__HEADLESS_MODE) {
         add_action('keyring_instagram_manage_ui', array($this, 'basic_ui'));
         add_filter('keyring_instagram_basic_ui_intro', array($this, 'basic_ui_intro'));
     }
     $this->set_endpoint('authorize', 'https://api.instagram.com/oauth/authorize/', 'GET');
     $this->set_endpoint('access_token', 'https://api.instagram.com/oauth/access_token', 'POST');
     $this->set_endpoint('self', 'https://api.instagram.com/v2/users/self', 'GET');
     $creds = $this->get_credentials();
     $this->app_id = $creds['app_id'];
     $this->key = $creds['key'];
     $this->secret = $creds['secret'];
     $this->consumer = new OAuthConsumer($this->key, $this->secret, $this->callback_url);
     $this->signature_method = new OAuthSignatureMethod_HMAC_SHA1();
     $this->authorization_header = false;
     // Send in querystring
     $this->authorization_parameter = 'access_token';
 }
Ejemplo n.º 5
0
 function __construct()
 {
     parent::__construct();
     // Enable "basic" UI for entering key/secret
     if (!KEYRING__HEADLESS_MODE) {
         add_action('keyring_facebook_manage_ui', array($this, 'basic_ui'));
         add_filter('keyring_facebook_basic_ui_intro', array($this, 'basic_ui_intro'));
     }
     $this->set_endpoint('authorize', 'https://www.facebook.com/dialog/oauth', 'GET');
     $this->set_endpoint('access_token', 'https://graph.facebook.com/oauth/access_token', 'GET');
     $this->set_endpoint('self', 'https://graph.facebook.com/me', 'GET');
     $creds = $this->get_credentials();
     $this->app_id = $creds['app_id'];
     $this->key = $creds['key'];
     $this->secret = $creds['secret'];
     $kr_nonce = wp_create_nonce('keyring-verify');
     $nonce = wp_create_nonce('keyring-verify-facebook');
     $this->redirect_uri = Keyring_Util::admin_url(self::NAME, array('action' => 'verify', 'kr_nonce' => $kr_nonce, 'nonce' => $nonce));
     $this->requires_token(true);
     add_filter('keyring_facebook_request_token_params', array($this, 'filter_request_token'));
 }
Ejemplo n.º 6
0
 function __construct()
 {
     parent::__construct();
     // Enable "basic" UI for entering key/secret
     if (!KEYRING__HEADLESS_MODE) {
         add_action('keyring_runkeeper_manage_ui', array($this, 'basic_ui'));
         add_filter('keyring_runkeeper_basic_ui_intro', array($this, 'basic_ui_intro'));
     }
     $this->set_endpoint('authorize', 'https://runkeeper.com/apps/authorize', 'GET');
     $this->set_endpoint('access_token', 'https://runkeeper.com/apps/token', 'POST');
     $this->set_endpoint('deauthorize', 'https://runkeeper.com/apps/de-authorize', 'POST');
     $this->set_endpoint('user', 'https://api.runkeeper.com/user', 'GET');
     $this->set_endpoint('profile', 'https://api.runkeeper.com/profile', 'GET');
     $creds = $this->get_credentials();
     $this->app_id = $creds['app_id'];
     $this->key = $creds['key'];
     $this->secret = $creds['secret'];
     $this->consumer = new OAuthConsumer($this->key, $this->secret, $this->callback_url);
     $this->signature_method = new OAuthSignatureMethod_HMAC_SHA1();
     $this->authorization_header = 'Bearer';
     $this->authorization_parameter = false;
 }
Ejemplo n.º 7
0
 function request($url, array $params = array())
 {
     // add header (version), required for all requests
     $params['headers']['GData-Version'] = self::API_VERSION;
     return parent::request($url, $params);
 }
Ejemplo n.º 8
0
 function request($url, array $params = array())
 {
     $url = add_query_arg(array('v' => self::API_VERSION), $url);
     return parent::request($url, $params);
 }
Ejemplo n.º 9
0
 function request($url, array $params = array())
 {
     $this->refresh_token();
     return parent::request($url, $params);
 }