appkey ? $this->appkey : 'http://' . $_SERVER['SERVER_NAME'])); $response = $this->fetch($url); if (preg_match('/short_url="([^"]*)/', $response, $results)) return $results[1]; return false; } /** * Default decoding function * * @param string $url Url to decode * @return void * @author Guillermo Rauch */ function decode($hash){ $url = sprintf('http://services.digg.com/url/short/%s?appkey=%s&type=xml', $hash, urlencode($this->appkey ? $this->appkey : 'http://' . $_SERVER['SERVER_NAME'])); $response = $this->fetch($url); if (preg_match('/link="([^"]*)/', $response, $results)) return $results[1]; return false; } } ?>