芝麻web文件管理V1.00
编辑当前文件:/home/seolotod/critterchoice.com/wp-content/plugins/wp-automatic/inc/youtube_class.php
ch = curl_init(); curl_setopt($this->ch, CURLOPT_HEADER,0); curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($this->ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($this->ch, CURLOPT_TIMEOUT,20); curl_setopt($this->ch, CURLOPT_REFERER, 'http://www.bing.com/'); curl_setopt($this->ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8'); curl_setopt($this->ch, CURLOPT_MAXREDIRS, 5); // Good leeway for redirections. curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, 1); // Many login forms redirect at least once. curl_setopt($this->ch, CURLOPT_COOKIEJAR , "cookie.txt"); } public function url2id() { $aux = explode("?",$this->url); $aux2 = explode("&",$aux[1]); foreach($aux2 as $campo => $valor) { $aux3 = explode("=",$valor); if($aux3[0] == 'v') $video = $aux3[1]; } return $this->id = $video; } public function url2id_($url) { $aux = explode("?",$url); $aux2 = explode("&",$aux[1]); foreach($aux2 as $campo => $valor) { $aux3 = explode("=",$valor); if($aux3[0] == 'v') $video = $aux3[1]; } return $this->id = $video; } public function thumb_url($tamanho=NULL) { $tamanho = $tamanho == "maior"?"hq":""; $this->url2id(); return 'http://i1.ytimg.com/vi/'.$this->id.'/'.$tamanho.'default.jpg'; } public function thumb($tamanho=NULL) { $tamanho = $tamanho == "maior"?"hq":""; $this->url2id(); return '
'; } public function info() { $feedURL = 'http://gdata.youtube.com/feeds/base/videos?q='.$this->id.'&client=ytapi-youtube-search&v=2'; $sxml = simplexml_load_file($feedURL); foreach ($sxml->entry as $entry) { $details = $entry->content; $info["titulo"] = $entry->title; } $details_notags = strip_tags($details); $texto = explode("From",$details_notags); $info["descricao"] = $texto[0]; $aux = explode("Views:",$texto[1]); $aux2 = explode(" ",$aux[1]); $info["views"] = $aux2[0]; $aux = explode("Time:",$texto[1]); $aux2 = explode("More",$aux[1]); $info["tempo"] = $aux2[0]; $imgs = strip_tags($details,'
'); $aux = explode("
",$aux[4]); array_pop($aux); $aux3 = $aux2[0].'gif">'; $aux[] = $aux3; $imagens = ''; foreach($aux as $campo => $valor) { $imagens .= '
ch, CURLOPT_HTTPGET, 1); curl_setopt($this->ch, CURLOPT_URL, wp_automatic_trim($url)); $exec=curl_exec($this->ch); $x=curl_error($this->ch); $sxml = simplexml_load_string($exec); $i=0; foreach ($sxml->entry as $entry) { if( stristr($entry->title, 'devicesupport') ) continue; $details = $entry->content; $author = $entry->author->name; $info[$i]["title"] = $entry->title; $info[$i] ['author'] = $author; $aux = explode($info[$i]["title"],$details); $aux2 = explode("
published); $imgs = strip_tags($details,'
'); $aux = explode("
",$aux[4]); array_pop($aux); $aux3 = $aux2[0].'gif">'; $aux[] = $aux3; $imagens = ''; foreach($aux as $campo => $valor) { $imagens .= '
'.$feedURL; //curl get $x='error'; $url=$feedURL; curl_setopt($this->ch, CURLOPT_HTTPGET, 1); curl_setopt($this->ch, CURLOPT_URL, wp_automatic_trim($url)); $exec=curl_exec($this->ch); $x=curl_error($this->ch); $sxml = simplexml_load_string($exec); $i=0; foreach ($sxml->entry as $entry) { if( stristr($entry->title, 'devicesupport') ) continue; $details = $entry->content; $info[$i]["title"] = $entry->title; $aux = explode($info[$i]["title"],$details); $aux2 = explode("
published); $imgs = strip_tags($details,'
'); $aux = explode("
",$aux[4]); array_pop($aux); $aux3 = $aux2[0].'gif">'; $aux[] = $aux3; $imagens = ''; foreach($aux as $campo => $valor) { $imagens .= '
url2id(); if(wp_automatic_trim($width) == '') $width=480; if(wp_automatic_trim($height) == '') $height=385; //return '
'; return '
'; } } ?>