EEfaq论坛-赚客自留地

 找回密码
 免费注册
12
返回列表 发新帖
楼主: HONG

Wordpress 评论求教

  [复制链接]
 楼主| 发表于 2013-9-14 17:35:36 | 显示全部楼层

您这样的大牛,博士生导师级别的, 拿小弟开玩笑吧  呵呵   

这个是我实现的代码:

<?php
$url = 'http://arcadegameworld.com/play/stone-age-mahjong-connect/';

$header = get_header($url);
echo $header;

function get_header($url){
    $ch  = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HEADER, true);
    curl_setopt($ch, CURLOPT_NOBODY,true);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
    //curl_setopt($ch, CURLOPT_FOLLOWLOCATION,true);
    curl_setopt($ch, CURLOPT_AUTOREFERER,true);
    curl_setopt($ch, CURLOPT_TIMEOUT,30);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Accept: */*',
    'User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)',
    'Connection: Keep-Alive'));
    $header = curl_exec($C);
    return $header;
}
?>



运行后的结果:



HTTP/1.1 200 OK
Date: Sat, 14 Sep 2013 09:28:54 GMT
Server: Apache
X-Pingback: http://arcadegameworld.com/xmlrpc.php
Link: <http://arcadegameworld.com/?p=3155>; rel=shortlink
Vary: Accept-Encoding
Connection: close
Content-Type: text/html; charset=UTF-8







回复 支持 反对

使用道具 举报

发表于 2013-9-14 17:48:10 | 显示全部楼层
HONG 发表于 2013-9-14 17:35
您这样的大牛,博士生导师级别的, 拿小弟开玩笑吧  呵呵   

这个是我实现的代码:

打算用php来做评论吗? 可以使用rollingcurl库

https://github.com/takinbo/rolling-curl


good luck!
回复 支持 反对

使用道具 举报

发表于 2013-9-16 13:03:40 | 显示全部楼层
有位兄弟回答了,确实可以直接在post里面看

回复 支持 反对

使用道具 举报

发表于 2013-10-4 09:09:25 | 显示全部楼层
这个原理不知道。。这个行业水深,大神很多
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

QQ|联系我们|Archiver|手机版|小黑屋|EEfaq论坛

GMT+8, 2024-5-15 11:56

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表