+ -
当前位置:首页 → 问答吧 → Delete

Delete

时间:2007-02-09

来源:互联网

Delete

[ 本帖最后由 lazy 于 2008-4-27 05:24 编辑 ]

作者: lazy   发布时间: 2007-02-09

小偷程序!;P

作者: cator   发布时间: 2007-02-09

复制内容到剪贴板
代码:
$Today=date('Ymd');
$url="http://www.sogou.com/history/history_$Today.html";
$contents=file_get_contents($url);
function cut($file,$from,$end,$num=1){
        $message=explode($from,$file);
        $message=explode($end,$message[$num]);
return        $message[0];
}
$data=cut($contents,"h1
","h1");
echo "历史上的今天 ".$data;
?>
比你的还要少几行
放在blog上就很好看了

[ 本帖最后由 onlyou 于 2007-2-9 14:06 编辑 ]

作者: onlyou   发布时间: 2007-02-09

allow_url_fopen = Off的时候
:D
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$contents= curl_exec($ch);
curl_close($ch);

作者: ※紫��   发布时间: 2007-02-12

采集现在很流行 啊

作者: leehui1983   发布时间: 2007-02-12

有意思

作者: hiler   发布时间: 2007-04-17

额也来凑凑热闹,嘿嘿
复制PHP内容到剪贴板
PHP代码:
$today = date('Ymd');
$url = "http://www.sogou.com/history/history_$today.html";
$contents = file_get_contents($url);
preg_match_all("/\<div id\=\"content1\"\>(.+)\<div class\=\"extend\"\>/s", $contents, $m);
echo str_replace(array("<div class=\"extend\">", "\"/images/history/"), array("", "\"http://www.sogou.com/images/history/"), $m[0][0]);

作者: Zandy   发布时间: 2007-04-23

:lol

作者: 特蓝克斯   发布时间: 2007-04-23

弄个循环语句,把搜狗的资料采集入库.

作者: hohoqi   发布时间: 2007-11-08

引用:
原帖由 hohoqi 于 2007-11-8 04:30 发表
弄个循环语句,把搜狗的资料采集入库.
这个主意好
省的每天去搞了

作者: psdshow   发布时间: 2007-11-08

都很强大。

作者: Ghoul   发布时间: 2007-11-08

各位高人,怎么写个正则式从下面的源代码中提取网址http://lalalalal.com/aaa/bbb/.gif啊?

<A class=link onclick="alert('请用右键另存为来下载照片n(Please right click and select save as...)');return false;" href=http://lalalalal.com/aaa/bbb/.gif target=_blank>

我自己用preg_match_all试了半天就是不成功。请大家帮忙写个语句。

作者: laplace   发布时间: 2007-11-20

从QQ群里的夜之子拿来的正则.
复制PHP内容到剪贴板
PHP代码:
$LinkType = "href";
$Regexp = '/[\\s]?(?:'.$LinkType.')[\\s]?=[\\s]?("(?:.+?)"|\'(?:.+?)\'|(?:.+?)[\\s>]?)(?:[\\s]+.*?)?>(.*?)<\/a>/sim';
preg_match($Regexp,$URL,$Array);
var_dump($Array):

作者: lazy   发布时间: 2007-11-21

大家继续,到了一定程度就可以考虑是否加精!!!

作者: luzhou   发布时间: 2007-11-21

作者: strongability   发布时间: 2008-01-15

图片的采集可以参照:http://www.phpchina.com/bbs/thread-47553-1-1.html

作者: dujiangtao   发布时间: 2008-01-16

热门下载

更多