Skip to content

Commit

Permalink
postInfo()
Browse files Browse the repository at this point in the history
  • Loading branch information
ionutmarchis committed Nov 23, 2015
1 parent 3f528f2 commit 66cc42c
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions lib/Tumblr/API/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,25 +370,8 @@ public function getSubmissionPosts($blogName, $options = null)

return $this->getRequest($path, $options, false);
}

/**
* Make a GET request to the given endpoint and return the response
*
* @param string $path the path to call on
* @param array $options the options to call with
* @param bool $addApiKey whether or not to add the api key
*
* @return array the response object (parsed)
*/
private function getRequest($path, $options, $addApiKey)
{
$response = $this->makeRequest('GET', $path, $options, $addApiKey);

return $this->parseResponse($response);
}

/**
* Make a GET request to the given endpoint and return the response
* Get post Info
*
* @param $blogName
* @param $postId
Expand All @@ -408,6 +391,23 @@ public function getPostInfo($blogName, $postId, $addApiKey)
$path = $this->blogPath($blogName, '/posts');
return $this->getRequest($path, $options, $addApiKey);
}
/**
* Make a GET request to the given endpoint and return the response
*
* @param string $path the path to call on
* @param array $options the options to call with
* @param bool $addApiKey whether or not to add the api key
*
* @return array the response object (parsed)
*/
private function getRequest($path, $options, $addApiKey)
{
$response = $this->makeRequest('GET', $path, $options, $addApiKey);

return $this->parseResponse($response);
}



/**
* Make a POST request to the given endpoint and return the response
Expand Down Expand Up @@ -514,7 +514,7 @@ private function blogPath($blogName, $ext)
*/
private function blogUrl($blogName)
{
if (strpos($blogName, '.') === false) {
if (strpos($blogName, '.tumblr.com') === false) {
return "$blogName.tumblr.com";
}

Expand Down

0 comments on commit 66cc42c

Please sign in to comment.