class sm00sh extends ShortUrlApi { function __construct() { parent::__construct('http://smsh.me/?api=xml&url='); } protected function shorten_imp($url) { $response = $this->http_get($url); if (!$response) return $url; $response = $this->tidy($response); $y = @simplexml_load_string($response); if (!isset($y)) return $url; if( @trim($y->title) == 'HTTP/1.0 200 OK' && !empty(@trim($y->body)) ) return @trim($y->body); return $url; } }