diff -r 000000000000 -r 4eba9c11703f web/Zend/Service/ShortUrl/JdemCz.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/Zend/Service/ShortUrl/JdemCz.php Mon Dec 13 18:29:26 2010 +0100 @@ -0,0 +1,84 @@ +_validateUri($url); + + $serviceUri = 'http://www.jdem.cz/get'; + + $this->getHttpClient()->setUri($serviceUri); + $this->getHttpClient()->setParameterGet('url', $url); + + $response = $this->getHttpClient()->request(); + + return $response->getBody(); + } + + /** + * Reveals target for short URL + * + * @param string $shortenedUrl URL to reveal target of + * @throws Zend_Service_ShortUrl_Exception When URL is not valid or is not shortened by this service + * @return string + */ + public function unshorten($shortenedUrl) + { + $this->_validateUri($shortenedUrl); + + $this->_verifyBaseUri($shortenedUrl); + + $this->getHttpClient()->setUri($shortenedUrl)->setParameterGet('kam', 1); + + $response = $this->getHttpClient()->request(); + + return $response->getBody(); + } +}