Skip to content

Commit

Permalink
shortener response parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
GutsVadim committed May 15, 2017
1 parent b5286cf commit 9048f68
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions GoogleUrlShortener.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class GoogleUrlShortener extends Component
function init()
{
parent::init();
$this->apiEndpoint .= $this->apiKey !== null ? '?key=' . $this->apiKey . '&' : '';
}

/**
Expand Down Expand Up @@ -40,6 +39,8 @@ public function shorten($longUrl)
'longUrl' => $longUrl
]);

return $request->content;
$response = $request->send();

return $response->data['id'];
}
}

0 comments on commit 9048f68

Please sign in to comment.