Пример #1
0
 /**
  * Constructor
  *
  * @param array $params	API parameters : token
  *
  * @throw Exception
  */
 public function __construct($params = array())
 {
     if (empty($params['token'])) {
         throw new Exception("Invalid access token");
     }
     $params['url'] = "https://www.googleapis.com/analytics/v3/";
     $params['accept'] = "application/json";
     parent::__construct($params);
 }
Пример #2
0
 /**
  * Constructor
  *
  * @param array $params	API parameters : key
  *
  * @throw Exception
  */
 function __construct($params = array())
 {
     if (empty($params['key'])) {
         throw new Exception("Invalid API key");
     }
     $params['url'] = "https://www.googleapis.com/youtube/v3/";
     $params['accept'] = "application/json";
     parent::__construct($params);
 }
Пример #3
0
 public function __construct($params = array())
 {
     if (empty($params['username']) || empty($params['password'])) {
         throw new Exception("Username of password undefined");
     }
     $params['url'] = "http://agenda.sowprog.com/rest/v1_2/";
     $params['accept'] = "application/json";
     parent::__construct($params);
 }
Пример #4
0
 /**
  * Constructor
  *
  * @param array $params	API parameters : token
  *
  * @throw Exception
  */
 function __construct($params = array())
 {
     if (empty($params['token'])) {
         throw new Exception("Missing access token");
     }
     $params['url'] = "https://api.vimeo.com/";
     $params['accept'] = "application/json";
     $params['authMode'] = "bearer";
     parent::__construct($params);
 }
Пример #5
0
 /**
  * Constructor
  *
  * @param array $params	API parameters : client_id
  *
  * @throw Exception
  */
 function __construct($params = array())
 {
     if (empty($params['client_id'])) {
         throw new Exception("Invalid client ID");
     }
     $this->key = $params['client_id'];
     $params['url'] = "http://api.soundcloud.com/";
     $params['accept'] = "application/json";
     parent::__construct($params);
 }
Пример #6
0
 /**
  * Constructor
  *
  * @param array $params	API parameters : token
  *
  * @throw Exception
  */
 public function __construct($params = array())
 {
     if (empty($params['client_id'])) {
         throw new Exception("Invalid client id");
     }
     if (empty($params['client_secret'])) {
         throw new Exception("Invalid client secret");
     }
     if (empty($params['token'])) {
         $params['token'] = $params['client_id'] . "|" . $params['client_secret'];
     }
     $params['url'] = "https://graph.facebook.com/v2.3/";
     $params['accept'] = "application/json";
     parent::__construct($params);
 }
Пример #7
0
 public function __construct()
 {
     $params = array('url' => "https://itunes.apple.com/", 'accept' => "application/json");
     parent::__construct($params);
 }
Пример #8
0
 /**
  * Constructor
  *
  * @param array $params	API parameters : key
  *
  * @throw Exception
  */
 function __construct($params = array())
 {
     $params['url'] = "https://api.dailymotion.com/";
     $params['accept'] = "application/json";
     parent::__construct($params);
 }
Пример #9
0
 /**
  * Constructor
  *
  * @param array $params	API parameters
  *
  * @throw Exception
  */
 function __construct($params = array())
 {
     $params['url'] = 'http://api.deezer.com/';
     $params['accept'] = 'application/json';
     parent::__construct($params);
 }