9 * This source file is subject to the new BSD license that is bundled
10 * with this package in the file LICENSE.
11 * It is also available through the world-wide-web at this URL:
12 * http://phergie.org/license
15 * @package Phergie_Plugin_Php
16 * @author Phergie Development Team <team@phergie.org>
17 * @copyright 2008-2010 Phergie Development Team (http://phergie.org)
18 * @license http://phergie.org/license New BSD License
19 * @link http://pear.phergie.org/package/Phergie_Plugin_Php
23 * Shortens urls via the tr.im service
26 * @package Phergie_Plugin_Url
27 * @author Phergie Development Team <team@phergie.org>
28 * @license http://phergie.org/license New BSD License
29 * @link http://pear.phergie.org/package/Phergie_Plugin_Url
31 class Phergie_Plugin_Url_Shorten_Trim extends Phergie_Plugin_Url_Shorten_Abstract
34 * Short a URL through the tr.im api
36 * @param string $url the url to shorten
38 * @return string string the shortened url
40 public function shorten($url)
42 return file_get_contents('http://api.tr.im/v1/trim_simple?url=' . rawurlencode($url));