cmd = "[yt]0gfniCDbbzg[/yt]";
echo 'message before parse: '.$command->cmd.'
';
$command->cmd = preg_replace_callback("|\[yt\](.*?)\[\/yt\]|", 'yt', $command->cmd);
//$command->cmd = preg_replace_callback("|\[yt (.*?)=(.*?) (.*?)=(.*?)\](.*?)\[\/yt\]|", 'yt', $command->cmd);
function get_tiny_url($url) {
$ch = curl_init();
$timeout = 5;
curl_setopt($ch,CURLOPT_URL,'http://tinyurl.com/api-create.php?url='.$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
function getTitle($Url){
echo "parse";
$ustr = parse_url($Url);
echo "file";
$ctx = stream_context_create(array(
'http' => array(
'timeout' => 10
)
)
);
$str = file_get_contents($Url, 0, $ctx);
echo "rest";
if(strlen($str)>0){
if(strpos($ustr['host'],'youtu')===FALSE){
preg_match("/\