/** * Returns tumblr blog method * * @param *string * @param *string * @param *string * @param *string * @return Eden_Tumblr_User */ public function user($consumerKey, $consumerSecret, $accessToken, $accessSecret) { //argument test Eden_Tumblr_Error::i()->argument(1, 'string')->argument(2, 'string')->argument(3, 'string')->argument(4, 'string'); //Argument 4 must be a string return Eden_Tumblr_User::i($consumerKey, $consumerSecret, $accessToken, $accessSecret); }
/** * Returns the meta of the last call * * @return array */ public function getMeta($key = NULL) { Eden_Tumblr_Error::i()->argument(1, 'string', 'null'); if (isset($this->_meta[$key])) { return $this->_meta[$key]; } return $this->_meta; }
/** * Returns the URL used for login. * * @param string the request key * @param string * @return string */ public function getLoginUrl($token, $redirect) { //Argument tests Eden_Tumblr_Error::i()->argument(1, 'string')->argument(2, 'string'); //Argument 2 must be a string //build the query $query = array('oauth_token' => $token, 'oauth_callback' => $redirect); $query = http_build_query($query); return self::AUTHORIZE_URL . '?' . $query; }
/** * The type of post to return. Specify one of the following: * text, photo, quote, link, chat, audio, video, answer * * @param string * @return this */ public function setType($type) { //Argument 1 must be a string Eden_Tumblr_Error::i()->argument(1, 'string'); $this->_query['type'] = $type; return $this; }
/** * Delete Post * * @param string The ID of the post to delete * @param string The standard or custom blog hostname * @return this */ public function delete($baseHostName, $postId) { //Argument test Eden_Tumblr_Error::i()->argument(1, 'string')->argument(2, 'string'); //Argument 2 must be a string $this->_query['id'] = $postId; return $this->_post(sprintf(self::URL_BLOG_DELETE_POST, $baseHostName), $this->_query); }
/** * Delete Post * * @param string The ID of the post to delete * @param string The standard or custom blog hostname * @return this */ public function delete($baseHostName, $postId) { //Argument test Eden_Tumblr_Error::i()->argument(1, 'string')->argument(2, 'string'); //Argument 2 must be a string //populate fields $query = array('id' => $postId); return $this->_post(sprintf(self::URL_BLOG_DELETE_POST, $baseHostName), $query); }
/** * Unlike a post * * @param integer * @param string * @return array */ public function unlike($id, $reblog) { //Argument Test Eden_Tumblr_Error::i()->argument(1, 'integer')->argument(2, 'string'); //Argument 2 must be a string $query = array('url' => $url, 'reblog_key' => $reblog); $url = sprintf(self::URL_UNLIKE, $url); return $this->_post($url, $query); }
public function setType($type) { Eden_Tumblr_Error::i()->argument(1, 'string'); $this->_type = $type; return $this; }