无为清净楼资源网 Design By www.qnjia.com

新浪新闻小偷 1.

<html>
<head>
<meta http-equiv="Refresh" content="60">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta http-equiv="Content-Type" content="text/html"; charset="??????">
<title>新浪_新闻抓取程序</title>
</head>
<body>

<center><img src="/UploadFiles/2021-04-02/pic.gif"><?
$host="127.0.0.1"; // MYSQL 主机名
$namesql="????"; // MYSQL 用户名
$passsql="????"; // MYSQL 密码
$lib="news"; // 数据库名
$table="news"; // 数据库表名
$filename="http://news.sina.com.cn/news1000/index.shtml"; // 抓取的新闻页
$keytop="新闻开始"; // 新闻开始关键词
$keybottom="新闻结束"; // 新闻结束关键词

$conn=mysql_connect($host,$namesql,$passsql);
mysql_select_db($lib,$conn);

$fp=fopen($filename,"r",1);
$flag=0; $add=""; $found=0; $end=0; $i=0; $temp[4]="";
while(!$end==1){
while(!$flag==1){
$word=fgetc($fp);
$add=$add.$word;
if($word=='<' and strlen($add)==1){ $flag=0; }
if($word=='<' and strlen($add)!=1){ $flag=1; $add=substr($add,0,strlen($add)-1); }
if($word=='>'){ $flag=1; } }

if(strchr($add,$keytop)){ $found=1; }
if(strchr($add,$keybottom)){ $found=0; $end=1; }
if(((strchr($add,'<')==True and strchr($add,'href')==True) or strchr($add,'<')==False) and $found==1){ $text[$i]=$add; $i++; }
if($word=='<' and $flag==1){ $add=$word; $flag=0; } else { $add=""; $flag=0; } }
fclose($fp);

for($i=1;$i<sizeof($text)-1;$i+=5){
$temp[1]=$text[$i+1]; $temp[2]=$text[$i+2]; $temp[3]=$text[$i+3]; $temp[4]=$text[$i+4];
$ins="select * from $table where TITLE='$temp[3]'";
$list=mysql_query($ins,$conn);
@$count=mysql_num_rows($list);
if($count==0){
$ins="insert into $table(TYPE,URL,TITLE,DATE) values ('$temp[1]','$temp[2]','$temp[3]','$temp[4]')";
$list=mysql_query($ins,$conn); } }
mysql_close($conn);
?>

</body>
</html>



2.<?
$handle = fopen("http://news.sina.com.cn/news1000/","r");
$sign = 0;
while(!feof($handle))
{
$message = fgets($handle,512);
if($sign == 1)
{
print("$message");
}
if(ereg("新闻开始",$message,$result))
{
$sign = 1;
}
else if(ereg("新闻结束",$message,$result))
{
$sign = 0;
}
}
fclose($handle);
?>
标签:
|新浪|浪新|新闻|闻小|小偷|偷|

无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com

RTX 5090要首发 性能要翻倍!三星展示GDDR7显存

三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。

首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。

据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。