pax_global_header00006660000000000000000000000064120607210540014507gustar00rootroot0000000000000052 comment=701da64bdef1fb9d317fdc06f62788509d1f5205 php-horde-service-urlshortener-2.0.1/000077500000000000000000000000001206072105400175655ustar00rootroot00000000000000php-horde-service-urlshortener-2.0.1/Horde_Service_UrlShortener-2.0.1/000077500000000000000000000000001206072105400254565ustar00rootroot00000000000000php-horde-service-urlshortener-2.0.1/Horde_Service_UrlShortener-2.0.1/lib/000077500000000000000000000000001206072105400262245ustar00rootroot00000000000000php-horde-service-urlshortener-2.0.1/Horde_Service_UrlShortener-2.0.1/lib/Horde/000077500000000000000000000000001206072105400272655ustar00rootroot00000000000000php-horde-service-urlshortener-2.0.1/Horde_Service_UrlShortener-2.0.1/lib/Horde/Service/000077500000000000000000000000001206072105400306655ustar00rootroot00000000000000000077500000000000000000000000001206072105400332425ustar00rootroot00000000000000php-horde-service-urlshortener-2.0.1/Horde_Service_UrlShortener-2.0.1/lib/Horde/Service/UrlShortenerBase.php000066400000000000000000000022511206072105400346250ustar00rootroot00000000000000php-horde-service-urlshortener-2.0.1/Horde_Service_UrlShortener-2.0.1/lib/Horde/Service/UrlShortener * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @category Horde * @package Service_UrlShortener */ /** * Horde_Service_UrlShortener Base class * * @author Michael J Rubinsky * @category Horde * @package Service_UrlShortener */ abstract class Horde_Service_UrlShortener_Base { /** * @var array */ protected $_params; /** * @var Horde_Http_Client */ protected $_http; /** * Constructor * * @param Horde_Http_Client $http [description] * @param array $params = array() [description] * * @return Horde_UrlShorten */ public function __construct(Horde_Http_Client $http, $params = array()) { $this->_http = $http; $this->_params = $params; } abstract public function shorten($url); }Exception.php000066400000000000000000000010251206072105400357070ustar00rootroot00000000000000php-horde-service-urlshortener-2.0.1/Horde_Service_UrlShortener-2.0.1/lib/Horde/Service/UrlShortener * @category Horde * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @package Service_UrlShortener */ class Horde_Service_UrlShortener_Exception extends Horde_Exception_Wrapped { } TinyUrl.php000066400000000000000000000024341206072105400353640ustar00rootroot00000000000000php-horde-service-urlshortener-2.0.1/Horde_Service_UrlShortener-2.0.1/lib/Horde/Service/UrlShortener * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @category Horde * @package Service_UrlShortener */ /** * UrlShortener class for TinyUrl. * * @author Michael J Rubinsky * @category Horde * @package Service_UrlShortener */ class Horde_Service_UrlShortener_TinyUrl extends Horde_Service_UrlShortener_Base { const API_URL = 'http://tinyurl.com/api-create.php'; /** * * @param string $url The URL to shorten * * @return string The shortened URL * @throws Horde_UrlShorten_Exception */ public function shorten($url) { $u = new Horde_Url(self::API_URL); $u = $u->setRaw(true)->add('url', $url); try { $response = $this->_http->get($u); } catch (Horde_Http_Exception $e) { throw new Horde_Service_UrlShortener_Exception($e); } return $response->getBody(); } }php-horde-service-urlshortener-2.0.1/package.xml000066400000000000000000000116521206072105400217070ustar00rootroot00000000000000 Horde_Service_UrlShortener pear.horde.org Horde_Service_UrlShortener Class Interfaces to various URL shortening services. Michael J Rubinsky mrubinsk mrubinsk@horde.org yes 2012-11-22 2.0.1 1.0.0 stable stable LGPL-2.1 * [jan] Re-packaged 2.0.0 release. 5.3.0 1.7.0 Horde_Exception pear.horde.org 2.0.0 3.0.0alpha1 3.0.0alpha1 Horde_Url pear.horde.org 2.0.0 3.0.0alpha1 3.0.0alpha1 Horde_Http pear.horde.org 2.0.0 3.0.0alpha1 3.0.0alpha1 1.0.0alpha1 1.0.0alpha1 alpha alpha 2011-10-11 LGPL-2.1 * First alpha release. 1.0.0RC1 1.0.0RC1 beta beta 2011-10-19 LGPL-2.1 * [jan] Fix dependency. 1.0.0 1.0.0 stable stable 2011-11-02 LGPL-2.1 * First stable release. 2.0.0alpha1 1.0.0 alpha stable 2012-07-05 LGPL-2.1 * First alpha release for Horde 5. 2.0.0beta1 1.0.0 beta stable 2012-07-19 LGPL-2.1 * First beta release for Horde 5. 2.0.0 1.0.0 stable stable 2012-10-30 LGPL-2.1 * First stable release for Horde 5. 2.0.1 1.0.0 stable stable 2012-11-22 LGPL-2.1 * [jan] Re-packaged 2.0.0 release.