예제 #1
0
 public function __construct($token, $developerId)
 {
     //argument test
     Eden_Google_Error::i()->argument(1, 'string')->argument(2, 'string');
     $this->_token = $token;
     $this->_developerId = $developerId;
 }
예제 #2
0
파일: message.php 프로젝트: brynner/postr
 /**
  * Delete a message 
  *
  * @param string
  * @param string
  * @return array
  */
 public function delete($messageId, $userId = self::DEFAULT_VALUE)
 {
     //argument test
     Eden_Google_Error::i()->argument(1, 'string')->argument(2, 'string');
     //argument 2 must be a string
     return $this->_delete(sprintf(self::URL_YOUTUBE_MESSAGE_GET, $userId, $messageId));
 }
 public function __construct($clientId, $clientSecret, $redirect)
 {
     //argument test
     Eden_Google_Error::i()->argument(1, 'string')->argument(2, 'string')->argument(3, 'string');
     //Argument 4 must be a string
     parent::__construct($clientId, $clientSecret, $redirect, self::REQUEST_URL, self::ACCESS_URL);
 }
예제 #4
0
파일: photo.php 프로젝트: annaqin/eden
 /**
  * Delete a photo
  *
  * @param string
  * @param string
  * @return array
  */
 public function delete($contactId, $userEmail = self::DAFAULT)
 {
     //argument test
     Eden_Google_Error::i()->argument(1, 'string')->argument(2, 'string');
     //argument 2 must be a string
     return $this->_delete(sprintf(self::URL_CONTACTS_GET_IMAGE, $userEmail, contactId), true);
 }
 public function __construct($clientId, $clientSecret, $redirect, $apiKey = NULL)
 {
     //argument test
     Eden_Google_Error::i()->argument(1, 'string')->argument(2, 'string')->argument(3, 'string')->argument(4, 'string', 'null');
     //Argument 4 must be a string or null
     $this->_apiKey = $apiKey;
     parent::__construct($clientId, $clientSecret, $redirect, self::REQUEST_URL, self::ACCESS_URL);
 }
예제 #6
0
파일: ratings.php 프로젝트: annaqin/eden
 /**
  * Dislike a video
  *
  * @param string
  * @return array
  */
 public function dislike($videoId)
 {
     //argument 1 must be a string
     Eden_Google_Error::i()->argument(1, 'string');
     //make a xml template
     $query = Eden_Template::i()->set(self::VALUE, self::DISLIKE)->parsePHP(dirname(__FILE__) . '/template/like.php');
     return $this->_post(sprintf(self::URL_YOUTUBE_RATINGS, $videoId), $query);
 }
예제 #7
0
파일: latitude.php 프로젝트: annaqin/eden
 public function __construct($api_key, $token)
 {
     //argument test
     Eden_Google_Error::i()->argument(1, 'string');
     Eden_Google_Error::i()->argument(2, 'string');
     $this->_google_api_key = $api_key;
     $this->_token = $token;
 }
 /**
  * Returns the meta of the last call
  *
  * @return array
  */
 public function getMeta($key = NULL)
 {
     Eden_Google_Error::i()->argument(1, 'string', 'null');
     if (isset($this->_meta[$key])) {
         return $this->_meta[$key];
     }
     return $this->_meta;
 }
예제 #9
0
파일: activity.php 프로젝트: brynner/postr
 /**
  * Retrieve all user's subtivity
  *
  * @param string
  * @return array
  */
 public function getSubtivity($userId = self::DEFAULT_VALUE)
 {
     //argument 1 must be a string
     Eden_Google_Error::i()->argument(1, 'string');
     //populate fields
     $query = array(self::RESPONSE => self::JSON_FORMAT, self::VERSION => self::VERSION);
     return $this->_getResponse(sprintf(self::URL_YOUTUBE_SUBTIVITY, $userId), $query);
 }
예제 #10
0
파일: elevation.php 프로젝트: brynner/postr
 /**
  * Returns elevation information
  *
  * @param string latitude,longitude pair in string(e.g. "40.714728,-73.998672") 
  * @return array
  */
 public function getResponse($location, $sensor = 'false')
 {
     //argument test
     Eden_Google_Error::i()->argument(1, 'string')->argument(2, 'string');
     //argument 2 must be a string
     $this->_query['locations'] = $location;
     $this->_query['sensor'] = $sensor;
     return $this->_getResponse(self::URL_MAP_ELEVATION, $this->_query);
 }
예제 #11
0
파일: geocoding.php 프로젝트: brynner/postr
 /**
  * Returns geocode information
  *
  * @param string
  * @param string
  * @return array
  */
 public function getResponse($address, $sensor = 'false')
 {
     //argument test
     Eden_Google_Error::i()->argument(1, 'string')->argument(2, 'string');
     //argument 2 must be a string
     $this->_query['address'] = $address;
     $this->_query['sensor'] = $sensor;
     return $this->_getResponse(self::URL_MAP_GEOCODING, $this->_query);
 }
예제 #12
0
파일: upload.php 프로젝트: brynner/postr
 /**
  * Upload video to youtube
  *
  * @return form
  */
 public function upload($uploadToken, $postUrl, $redirectUrl)
 {
     //argument test
     Eden_Google_Error::i()->argument(1, 'object', 'string')->argument(2, 'object', 'string')->argument(3, 'string');
     //argument 3 must be a string
     //make a xml template
     $query = Eden_Template::i()->set(self::UPLOAD_TOKEN, $uploadToken)->set(self::REDIRECT_URL, $redirectUrl)->set(self::POST_URL, $postUrl)->parsePHP(dirname(__FILE__) . '/template/form.php');
     return $query;
 }
 /**
  * Returns elevation information
  *
  * @param string latitude,longitude pair in string(e.g. "40.714728,-73.998672") 
  * @return array
  */
 public function getElevation($location, $sensor = 'false')
 {
     //argument test
     Eden_Google_Error::i()->argument(1, 'string')->argument(2, 'string');
     //argument 2 must be a string
     //populate paramenter
     $query = array('locations' => $ocation, 'sensor' => $sensor, 'path' => $this->_path, 'samples' => $this->_samples);
     //optional
     return $this->_getResponse(self::URL_MAP_ELEVATION, $query);
 }
예제 #14
0
파일: form.php 프로젝트: taqmaninw/apipack
 /**
  * Returns a checkout form
  *
  * @param string
  * @param string|integer
  * @param string
  * @param string|integer
  * @param string 
  * @param boolean Set to false for live url
  * @return array
  */
 public function checkoutForm($itemName, $price, $description, $quantity, $currency = 'USD', $test = true)
 {
     //argument test
     Eden_Google_Error::i()->argument(1, 'string')->argument(2, 'string', 'int')->argument(3, 'string')->argument(4, 'string', 'int')->argument(5, 'string')->argument(6, 'bool');
     //argument 6 must be a booelean
     if ($test = true) {
         //set url to sandbox
         $url = sprintf(self::URL_TEST_CHECKOUT, $this->_merchantId);
     } else {
         //set url to live account
         $url = sprintf(self::URL_LIVE_CHECKOUT, $this->_merchantId);
     }
     //make a xml template
     $form = Eden_Template::i()->set('url', $url)->set('itemName', $itemName)->set('itemDescription', $description)->set('itemPrice', $price)->set('itemCurrency', $currency)->set('itemQuantity', $quantity)->set('merchantId', $this->_merchantId)->parsePHP(dirname(__FILE__) . '/template/form.php');
     return $form;
 }
예제 #15
0
파일: people.php 프로젝트: annaqin/eden
 /**
  * List all of the people in the specified 
  * collection for a particular activity
  *
  * @param string
  * @param string
  * @return array
  */
 public function getActivityList($activityId, $collection)
 {
     //argument test
     Eden_Google_Error::i()->argument(1, 'string')->argument(2, 'string');
     //argument 1 must be a string
     //if the input value is not allowed
     if (!in_array($collection, array('plusoners', 'resharers'))) {
         //throw error
         Eden_Google_Error::i()->setMessage(Eden_Google_Error::INVALID_COLLECTION)->addVariable($collection)->trigger();
     }
     $this->_query[self::ACTIVITY_ID] = $activityId;
     $this->_query[self::COLLECTION] = $collection;
     return $this->_getResponse(sprintf(self::URL_PEOPLE_ACTIVITY, $activityId, $collection), $this->_query);
 }
 /**
  * Returns a collection of videos that match the API request parameters.
  *
  * @param string
  * @param string
  * @return array
  */
 public function getChannelByRegion($regionId, $feeds)
 {
     //argument test
     Eden_Google_Error::i()->argument(1, 'string')->argument(2, 'string');
     //argument 2 must be a string
     //if the input value is not allowed
     if (!in_array($feeds, array('most_viewed', 'most_subscribed'))) {
         //throw error
         Eden_Google_Error::i()->setMessage(Eden_Google_Error::INVALID_FEEDS_TWO)->addVariable($feeds)->trigger();
     }
     //populate parameters
     $query = array(self::VERSION => self::VERSION_TWO);
     return $this->_getResponse(sprintf(self::URL_YOUTUBE_REGION, $regionId, $feeds), $query);
 }
예제 #17
0
파일: management.php 프로젝트: annaqin/eden
 /**
  * Returns lists of goals to which the user has access
  *
  * @param string
  * @param string
  * @param string
  * @return array
  */
 public function getGoals($accountId = self::ALL, $webPropertyId = self::ALL, $profileId = self::ALL)
 {
     //argument test
     Eden_Google_Error::i()->argument(1, 'string')->argument(2, 'string')->argument(3, 'string');
     //argument 3 must be a string
     //populate parameters
     $query = array(self::START_INDEX => $this->_startIndex, self::MAX_RESULTS => $this->_maxResults);
     //optional
     return $this->_getResponse(sprintf(self::URL_ANALYTICS_GOALS, $accountId, $webPropertyId, $profileId), $query);
 }
예제 #18
0
파일: userinfo.php 프로젝트: annaqin/eden
 public function __construct($token)
 {
     //argument test
     Eden_Google_Error::i()->argument(1, 'string');
     $this->_token = $token;
 }
예제 #19
0
파일: groups.php 프로젝트: annaqin/eden
 /**
  * Delete a group
  *
  * @param string
  * @param string
  * @return array
  */
 public function delete($groupId, $userEmail = self::DEFAULT_VALUE)
 {
     //argument test
     Eden_Google_Error::i()->argument(1, 'string')->argument(2, 'string');
     //argument 2 must be a string
     return $this->_delete(sprintf(self::URL_CONTACTS_GROUPS_GET, $userEmail, $groupId), true);
 }
예제 #20
0
파일: comment.php 프로젝트: annaqin/eden
 /**
  * Delete a comment
  *
  * @param string
  * @param string
  * @return array
  */
 public function delete($videoId, $commentId)
 {
     //argument test
     Eden_Google_Error::i()->argument(1, 'string')->argument(2, 'string');
     //argument 2 must be a string
     return $this->_delete(sprintf(self::URL_YOUTUBE_COMMENTS, $videoId, $commentId));
 }
예제 #21
0
파일: base.php 프로젝트: annaqin/eden
 /**
  * Well format xml  
  *
  * @param string|object
  * @return xml
  */
 public function formatToXml($query)
 {
     //argument 1 must be a string or object
     Eden_Google_Error::i()->argument(1, 'string', 'object');
     $xml = new DOMDocument();
     $xml->preserveWhiteSpace = false;
     $xml->formatOutput = true;
     $xml->loadXML($query);
     return $xml->saveXML();
 }
예제 #22
0
 /**
  * Updates a permission.
  *
  * @param string
  * @param string
  * @return array
  */
 public function update($fileId, $permissionId)
 {
     //argument test
     Eden_Google_Error::i()->argument(1, 'string')->argument(2, 'string');
     //argument 2 must be a string
     return $this->_put(sprintf(self::URL_PERMISSIONS_GET, $fileId, $permissionId), $this->_query);
 }
예제 #23
0
파일: history.php 프로젝트: annaqin/eden
 /**
  * Delete a specific history
  *
  * @param string
  * @return array
  */
 public function deleteSpecific($historyId)
 {
     //argument 1 must be a string
     Eden_Google_Error::i()->argument(1, 'string');
     return $this->_delete(sprintf(self::URL_YOUTUBE_HISTORY_GET, $historyId));
 }
예제 #24
0
파일: event.php 프로젝트: annaqin/eden
 /**
  * Update Calendar specific events
  *
  * @param string Event identifier
  * @param string Calendar identifier
  * @return array
  */
 public function update($eventId, $calendarId = self::PRIMARY)
 {
     //argument testing
     Eden_Google_Error::i()->argument(1, 'string')->argument(2, 'string');
     //argument 2 must be a string
     return $this->_put(sprintf(self::URL_CALENDAR, $calendarId, $eventId), $this->_query);
 }
예제 #25
0
파일: oauth.php 프로젝트: taqmaninw/apipack
 /**
  * Returns website login url
  *
  * @param string|null
  * @param string|null
  * @return url
  */
 public function getLoginUrl($scope = NULL, $display = NULL)
 {
     //argument test
     Eden_Google_Error::i()->argument(1, 'string', 'array', 'null')->argument(2, 'string', 'array', 'null');
     //argument 2 must be a string, array or null
     //if scope is a key in the scopes array
     if (is_string($scope) && isset($this->_scopes[$scope])) {
         $scope = $this->_scopes[$scope];
         //if it's an array
     } else {
         if (is_array($scope)) {
             //loop through it
             foreach ($scope as $i => $key) {
                 //if this is a scope key
                 if (is_string($key) && isset($this->_scopes[$key])) {
                     //change it
                     $scope[$i] = $this->_scopes[$key];
                 }
             }
         }
     }
     return parent::getLoginUrl($scope, $display);
 }
예제 #26
0
 /**
  * Returns a collection of videos that match the API request parameters.
  *
  * @param string
  * @return array
  */
 public function getResponse($queryString)
 {
     //argument 1 must be a string
     Eden_Google_Error::i()->argument(1, 'string');
     $this->_query[self::QUERY] = $queryString;
     $this->_query[self::VERSION] = self::VERSION_TWO;
     return $this->_getResponse(self::URL_YOUTUBE_SEARCH, $this->_queryquery);
 }
예제 #27
0
파일: video.php 프로젝트: annaqin/eden
 /**
  * Returns a collection of videos that match the API request parameters.
  *
  * @param string
  * @return array
  */
 public function getListByRegion($regionId)
 {
     //argument test
     Eden_Google_Error::i()->argument(1, 'string');
     //populate parameters
     $query = array(self::VERSION => self::VERSION_TWO);
     return $this->_getResponse(sprintf(self::URL_YOUTUBE_REGION, $regionId, $this->_feeds), $query);
 }
예제 #28
0
파일: parent.php 프로젝트: brynner/postr
 /**
  * Adds a parent folder for a file.
  *
  * @param string
  * @param string
  * @return array
  */
 public function insert($fileId, $parentId)
 {
     //argument test
     Eden_Google_Error::i()->argument(1, 'string')->argument(2, 'string');
     //argument 2 must be a string
     //populate fields
     $query = array(self::ID => $parentId);
     return $this->_post(sprintf(self::URL_PARENT_LIST, $fileId), $query);
 }
예제 #29
0
 /**
  * Set spell checker
  *
  * @param bool
  * @return this
  */
 public function setSpellChecker($value = true)
 {
     Eden_Google_Error::i()->argument(1, 'bool');
     $this->_spellChecker = $value;
     return $this;
 }
예제 #30
0
 /**
  * Gets a specific changes.
  *
  * @param string The ID of the change
  * @return array
  */
 public function getSpecific($changeId)
 {
     //argument test
     Eden_Google_Error::i()->argument(1, 'string');
     return $this->_getResponse(sprintf(self::URL_DRIVE_CHANGES_GET, $changeId));
 }