//隐逸鸟
$url="http://tech.qq.com/web/index.htm";
$contents=file_get_contents($url);
eregi("
- (.*)
$rg=strip_tags($rg[1]);
//时间
preg_match_all("//[(.*)/]/",$rg,$time);
$time=$time[0];
//内容
$rg=preg_replace("//[(.*)/]/","",$rg);
$rg=explode("·",$rg);
unset($rg[0]);
header("content-type:image/png");
$img=imageCreate(700,1080);
$color1=ImageColorAllocate($img,0xff,0xda,0xea);
$color2=ImageColorAllocate($img,0,0,0);
$color3=ImageColorAllocate($img,0xff,0,0);
$font="./font/cs.ttf";
$my_text1="腾讯科技频道-互联网新闻(同步更新采集)";
$my_text2="--隐逸鸟 QQ380997353";
//标头:
$my_text1=iconv("GB2312","UTF-8",$my_text1);
$my_text2=iconv("GB2312","UTF-8",$my_text2);
ImageTtfText($img,16,0,10,24,$color3,$font,$my_text1);
ImageTtfText($img,11,0,460,24,$color3,$font,$my_text2);
ImageLine($img,8,30,690,30,$color2);
for($i=1;$i
$rg[$i]=iconv("GB2312","UTF-8",$rg[$i]);
$j=$i;
if($j<10){$j="0".$j;}
ImageTtfText($img,12,0,10,$i*20+40,$color3,$font,"$j >> ".$rg[$i]);
}
for($i=1;$i
$time[$i]=iconv("GB2312","UTF-8",$time[$i]);
ImageTtfText($img,12,0,500+15,$i*20+40,$color3,$font,$time[$i-1]);
}
ImageLine($img,8,1010+40,690,1010+40,$color2);
imagePNG($img);
imageDestroy($img);
?>