20行代码的天气预报小偷程序

  • 作者:佚名 来源:互联网 文章点击数:

<?php
$class=$_GET["class"];
if($class=="gnga24") $class="gnga24w";//替换新浪天气预报的错误
if($class==true&&$class!="index.") $url="http://weather.sina.com.cn/text/".$class.".html";
else $url="http://weather.sina.com.cn/text/index.shtml";
$handle = fopen ("$url", "rb");
$contents = "";
do {
$data = fread($handle, 8192);
if (strlen($data) == 0)break;
$contents .= $data;
} while(true);
fclose ($handle);
$contents=strstr($contents,"订阅短信天气预报");
$contents=strstr($contents,"<TABLE");
$end=strpos($contents,"<!--开始:底部-->");
$contents=substr($contents,0,$end);
$contents=ereg_replace("href=","href=".$_SERVER[PHP_SELF]."?class=",$contents);
$contents=ereg_replace(".html","",$contents);//替换新浪天气预报的错误
echo $contents;
?>

Tags:代码 天气预报
  • 相关文章

Copyright 2006-2008 Powered by Noheart.NET无心人网络 All Rights Reserved.

QQ:89232083 E-Mail:leijian212@163.com

豫ICP备08004854号