想搞个奥运奖牌榜小偷,要如何搞?

mdot 2004-08-07 07:57:08
奥运到了,想在自己的个人站点放个奥运奖牌榜,用PHP实现,请各位讲解思路,
...全文
291 20 打赏 收藏 转发到动态 举报
写回复
用AI写文章
20 条回复
切换为时间正序
请发表友善的回复…
发表回复
-神仙- 2005-01-01
  • 打赏
  • 举报
回复
这个贴怎么还在阿

作  者: mdot ()
等  级:
信 誉 值: 87


难怪
surfchen 2004-12-31
  • 打赏
  • 举报
回复
http://www.yubeinet.com/bbs/wdbread.php?forumid=15&filename=f_354&fpage=3
nullfox 2004-12-31
  • 打赏
  • 举报
回复
晕了 http://weather.news.sina.com.cn/index48.html 这个数据几个月没更新了
loogle 2004-10-08
  • 打赏
  • 举报
回复
收下了!
fivetwogtt 2004-08-12
  • 打赏
  • 举报
回复
其中的action请初始化为:index48
fivetwogtt 2004-08-12
  • 打赏
  • 举报
回复
下面这个是偷取新浪天气预报的
参考一下吧:
============================
<?
if (function_exists('set_time_limit') == 1 && @ini_get('safe_mode') == 0) {
@set_time_limit(1000);
}
@ob_implicit_flush();
@clearstatcache();
?>
<html><head>
<meta http-equiv="Content-type" content="text/html; charset=gb2312">
<title>天气预报</title>
<style>
td,p,li,select,input {font-size:12px}
.l15{line-height:150%;}
IMG{border:0px}
.img01{border:1 solid #000000;}
.f14{font-size:14px;}
A:hover {color: ff0000;}
A.title1,A.title1:hover {font-size:17px;font-family:arial;font-weight:bold;text-decoration:none;color:#000000;}
A.title2:link,A.title2:visited {text-decoration:none;color:#000000;}
A.title2:active,A.title2:hover {text-decoration:none;color:#ff0000;}
A.sinatail:link,A.sinatail:visited {text-decoration:underline;color:#0000ff;font-size:12px}
A.sinatail:active,A.sinatail:hover {text-decoration:underline;color:#ff0000;font-size:12px}

.h3 {font-size:7px;color:#FFBD00}

A.a01:link,A.a01:visited {text-decoration:none;color:#07015B;}
A.a01:active,A.a01:hover {text-decoration:none;color:#ff0000;}

A.a02:link,A.a02:visited {color:#808080;}
A.a02:active,A.a02:hover {color:#ff0000;}

A.a03:link,A.a03:visited {text-decoration:none;color:#808080;}
A.a03:active,A.a03:hover {text-decoration:none;color:#ff0000;}

.td01{border-right:1 solid #ffffff;border-bottom:1 solid #ffffff}
</style>
</head>
<body bgcolor=#ffffff topmargin=5 marginheight=5 leftmargin=5 marginwidth=5>
<center>
<?
$action=$_GET[action];
if(!$action)$action="index";
$url="http://weather.news.sina.com.cn/".$action.".html";
$ob=fopen($url,"r") ;
// $str = @fread ($ob, 49306);
$str='';
$temp='';
while(!feof($ob)){
$temp=fgets($ob,1024);
$str=$str.$temp;
}
fclose($ob);
$a=explode("<TABLE cellSpacing=0 cellPadding=0 width=750 border=0>",$str);
if(strstr($a[3],'更新')){

$s1=" <TABLE cellSpacing=0 cellPadding=0 width=750 border=0>".$a[4];
$a[5]=" <TABLE cellSpacing=0 cellPadding=0 width=750 border=0>".$a[5];
$count=count($a);
for($i=6;$i<$count;$i++){
$a[5]=$a[5]."<TABLE cellSpacing=0 cellPadding=0 width=750 border=0>".$a[$i];
}
$a1=explode("<!-- 访问Log统计测试 : begin -->",$a[5]);
$str=$s1.$a1[0];
}else{
$s1=" <TABLE cellSpacing=0 cellPadding=0 width=750 border=0>".$a[3];
$a[4]=" <TABLE cellSpacing=0 cellPadding=0 width=750 border=0>".$a[4];
$count=count($a);
for($i=5;$i<$count;$i++){
$a[4]=$a[4]."<TABLE cellSpacing=0 cellPadding=0 width=750 border=0>".$a[$i];
}
$a1=explode("<!-- 访问Log统计测试 : begin -->",$a[4]);
$str=$s1.$a1[0];
}
$str=str_replace("href=","href=?action=",$str);
$str=str_replace(".html","",$str);
echo $str;

?>
</center>
</body>
</html>
mdot 2004-08-08
  • 打赏
  • 举报
回复
我想这样做,将抽取的页面变为XML形式,这样在XML中抽取数据就方便了,
XML中如何用XML呀?
mdot 2004-08-08
  • 打赏
  • 举报
回复
不行呀,我试过了
zairwolfc 2004-08-08
  • 打赏
  • 举报
回复
读取了以后再选择部分字节即可。
mdot 2004-08-08
  • 打赏
  • 举报
回复
但我只想取部分数据呀,将这些数据放到我预先的模版中呀
张海霖 2004-08-08
  • 打赏
  • 举报
回复
file("http://www.sohu.com")可以抓取网页
mdot 2004-08-08
  • 打赏
  • 举报
回复
UP
mdot 2004-08-08
  • 打赏
  • 举报
回复
想实现下抓取页面而已
mdot 2004-08-07
  • 打赏
  • 举报
回复
能否举个例子?
edlongren 2004-08-07
  • 打赏
  • 举报
回复
很简单的,
远程打开url,然后读取,折分就可以了。
tod204 2004-08-07
  • 打赏
  • 举报
回复
用file()函数抓回去,再解析.
-神仙- 2004-08-07
  • 打赏
  • 举报
回复
直接用readfile抓回去再解析
mdot 2004-08-07
  • 打赏
  • 举报
回复
哎呀,个人学习下咯,有什么问题呢?
zairwolfc 2004-08-07
  • 打赏
  • 举报
回复
不大好,小心被抓。
zairwolfc 2004-08-07
  • 打赏
  • 举报
回复
偷东西犯法。

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧