web/lib/Zend/Service/ShortUrl/TinyUrlCom.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
--- a/web/lib/Zend/Service/ShortUrl/TinyUrlCom.php	Thu Mar 21 17:31:31 2013 +0100
+++ b/web/lib/Zend/Service/ShortUrl/TinyUrlCom.php	Thu Mar 21 19:50:53 2013 +0100
@@ -14,7 +14,7 @@
  *
  * @category   Zend
  * @package    Zend_Service_ShortUrl
- * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  * @version    $Id: $
  */
@@ -29,7 +29,7 @@
  *
  * @category   Zend
  * @package    Zend_Service_ShortUrl
- * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Service_ShortUrl_TinyUrlCom extends Zend_Service_ShortUrl_AbstractShortener
@@ -40,7 +40,7 @@
      * @var string
      */
     protected $_baseUri = 'http://tinyurl.com';
-    
+
     /**
      * This function shortens long url
      *
@@ -53,12 +53,12 @@
         $this->_validateUri($url);
 
         $serviceUri = 'http://tinyurl.com/api-create.php';
-        
+
         $this->getHttpClient()->setUri($serviceUri);
         $this->getHttpClient()->setParameterGet('url', $url);
-        
+
         $response = $this->getHttpClient()->request();
-        
+
         return $response->getBody();
     }
 
@@ -72,29 +72,29 @@
     public function unshorten($shortenedUrl)
     {
         $this->_validateUri($shortenedUrl);
-        
+
         $this->_verifyBaseUri($shortenedUrl);
-        
+
         //TinyUrl.com does not have an API for that, but we can use preview feature
         //we need new Zend_Http_Client
         $this->setHttpClient(new Zend_Http_Client());
-        
+
         $this->getHttpClient()
              ->setCookie('preview', 1)
              ->setUri($shortenedUrl);
 
         //get response
         $response = $this->getHttpClient()->request();
-        
+
         require_once 'Zend/Dom/Query.php';
         $dom = new Zend_Dom_Query($response->getBody());
-        
+
         //find the redirect url link
         $results = $dom->query('a#redirecturl');
-        
+
         //get href
         $originalUrl = $results->current()->getAttribute('href');
-        
+
         return $originalUrl;
     }
 }