';
$ch = curl_init(); ///get keyword
curl_setopt($ch, CURLOPT_URL, "http://api.search.yahoo.co.jp/AssistSearchService/V1/webunitSearch?appid=YahooDemo&query=".$title[1]."&results=100");
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); //如果希望获得内容但不输出,使用该参数,并设为非0值
$kre = curl_exec($ch);
preg_match_all("|';}
echo '';
$re=preg_replace("''i", "",$re);//
$re=preg_replace("'<(.*?(3217916|amazon|neowing|addthis|3988185).*?)>'i", "",$re);//
$re=preg_replace("'\ |
||
|---|---|---|
if (date("s")%2==1)
{$url='http://rank.music.yahoo.co.jp/rank/al/al/ti/d';
$cachefileb = 'cache1/'.urlencode($url);
$cachetime = 20* 3600; // 3000 minutes
// Serve from the cache if it is younger than $cachetime
if (file_exists($cachefileb) && (time() - $cachetime
< filemtime($cachefileb))) :
{
include($cachefileb);
}
else :
ob_start(); // start the output buffer
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); //如果希望获得内容但不输出,使用该参数,并设为非0值
$re = curl_exec($ch);
preg_match_all("/\/rank\/al\/al\/ti\/d\/20([^<]*?)\/0\//", $re, $url);
$url='http://rank.music.yahoo.co.jp/rank/al/al/ti/d/20'.$url[1][0].'/0/';
//echo $url;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); //如果希望获得内容但不输出,使用该参数,并设为非0值
$re = curl_exec($ch);
$re = mb_convert_encoding($re, "UTF-8", "euc");
echo '総合ランキング';
$re = strstr($re,'');
$re = preg_replace("/\>\
CD購入','',$re);
$re = preg_replace("/href\=\"http\:\/\/music\.yahoo\.co\.jp\/shop\/c.*?\"\>(.*?)\<\/a/","title=\"$1の無料mp3\" href=\"/$1/mp3.html\" target=_blank>$1(.*?)\ \","title=\"$1の無料mp3\" href=\"/$1/mp3.html\" target=_blank>$1<",$re);
echo $re;
$fp = fopen($cachefileb, 'w');
// save the contents of output buffer to the file
fwrite($fp, ob_get_contents());
// close the file
fclose($fp);
// Send the output to the browser
ob_end_flush();
endif;}
else
{
$url='http://www.utamap.com/accessranking/weekly_ranking.html';
$cachefileb = 'cache1/'.urlencode($url);
$cachetime = 50* 3600; // 3000 minutes
// Serve from the cache if it is younger than $cachetime
if (file_exists($cachefileb) && (time() - $cachetime
< filemtime($cachefileb))) :
{
include($cachefileb);
}
else :
ob_start(); // start the output buffer
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); //如果希望获得内容但不输出,使用该参数,并设为非0值
$re = curl_exec($ch);
$re = mb_convert_encoding($re, "UTF-8", "sjis");
preg_match_all("/\
/s", $re, $name);
echo 'アクセスランキング';
$re = preg_replace("/\
.*?CD購入\<\/FONT\>\<\/a\>\ \<\/TD\>/s",'',$name[0][0]);
$re=str_replace(' CD購入 ','',$re);
$re = preg_replace("/href\=\".*?\"\>(.*?)\$1<",$re);
$re = preg_replace("/\ noWrap\>(.*?)\ \$1<",$re);
$fp = fopen($cachefileb, 'w');
// save the contents of output buffer to the file
fwrite($fp, ob_get_contents());
// close the file
fclose($fp);
ob_end_flush();
endif;}?>