过期域名预定抢注

 找回密碼
 免费注册

Wordpress 評論求教

  [複製鏈接]
 樓主| 發表於 2013-9-14 17:35:36 | 顯示全部樓層
luguokankan 發表於 2013-9-14 17:32 # r) H0 j- T: S4 D, \9 z( [! W
做出來記得給我一份啊
/ \) F" G5 P: s8 o
您這樣的大牛,博士生導師級別的, 拿小弟開玩笑吧  呵呵   / h! N  {' v5 Y
% s; Z. ]# Y; ^7 a; p) w, V1 e
這個是我實現的代碼:
) ?# s' d& A8 `8 \1 W: c' P2 B) _8 w: Q7 A( W# B
<?php! X6 b$ ]: }7 H' H' E
$url = 'http://arcadegameworld.com/play/stone-age-mahjong-connect/';  P/ l: }% K3 l; A" F
0 F6 J7 [  {& r
$header = get_header($url);$ H3 g. \5 H2 ?. ]# ]4 `) b
echo $header;
3 g; ~6 c$ {; {4 _3 g4 O8 l/ m) U7 F! D
function get_header($url){3 s" h5 M2 o, D. z/ X
    $ch  = curl_init();7 J5 O+ p1 X9 ~0 h4 s5 [
    curl_setopt($ch, CURLOPT_URL, $url);
6 ]: `7 U4 V8 P    curl_setopt($ch, CURLOPT_HEADER, true);
5 @  `4 \$ ?7 f3 n( R/ Q! [    curl_setopt($ch, CURLOPT_NOBODY,true);# l3 O- ]4 R' M" d4 |
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);( I9 \2 n& E( J  |" Z. A
    //curl_setopt($ch, CURLOPT_FOLLOWLOCATION,true);- ?4 O/ V3 H$ O3 t
    curl_setopt($ch, CURLOPT_AUTOREFERER,true);
9 n9 A. |$ Y2 k; ^    curl_setopt($ch, CURLOPT_TIMEOUT,30);7 S5 @$ g+ y7 J  l
    curl_setopt($ch, CURLOPT_HTTPHEADER, array() y6 J; ]# H7 \. B# `9 S. o( V
    'Accept: */*',
) B& e  b; y$ e7 x. q    'User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)',
4 P6 @, I. p1 f, p2 W+ s    'Connection: Keep-Alive'));0 A3 V) V! d9 C; M
    $header = curl_exec($C);
- r2 M* n/ c% ?( k; Z6 J  T" M    return $header;5 u0 T6 M9 J) c, Q9 L- Q1 z
}
! r7 f0 t. Q* S2 g+ E% H1 m?> 7 r8 r7 h+ P! H, K' R. t0 H; O

; {: L' w8 K/ Q& f! Y; G; u+ c& \$ V' u+ A# Z4 [  h

) O* F" y( v- U5 x: M( m$ O運行後的結果:
( T0 j6 G! U) F4 Y* U
* r, u5 w0 }7 \
( E) n/ p, |- E7 V/ [2 {  v5 N9 k# O& d' y+ n
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

. p9 ?/ q4 y0 n- @% b' P: E
* Y% @9 K. c: `0 z
) X2 x( X: K( g. N1 t9 U- ^  O$ `
( T3 P  g2 b3 a% `  e7 K1 ?0 Q
$ L( m  a3 V; A' j/ g5 z6 m& P, F  x5 g; w9 U7 e

8 G5 A5 F5 p8 Q8 F
回復 给力 爆菊

使用道具 舉報

發表於 2013-9-14 17:48:10 | 顯示全部樓層
HONG 發表於 2013-9-14 17:35 : K" I7 U% S) I; R- w0 u
您這樣的大牛,博士生導師級別的, 拿小弟開玩笑吧  呵呵   4 X+ b3 F/ i$ g6 q! m7 M
" ~  ?& ~1 R. [; D
這個是我實現的代碼:
0 b- S! m, M- Z( o2 H/ V( J
打算用php來做評論嗎? 可以使用rollingcurl庫  ]1 V# _" f1 [' m

/ e/ T% }+ n/ L4 q, d/ d  Xhttps://github.com/takinbo/rolling-curl
" |6 d3 o6 T; [  Y# W6 B9 A
0 t* [  a% m- T) [8 p' k% R! e
! T8 a4 i: y) r9 X3 h* B# pgood luck!5 g8 a0 g2 `- K+ S+ p1 \" O
回復 给力 爆菊

使用道具 舉報

發表於 2013-9-16 13:03:40 | 顯示全部樓層
有位兄弟回答了,確實可以直接在post裡面看$ R1 o/ [5 c5 O* {+ E

. r8 O5 {. C0 j, i4 L3 a* ~9 }" o5 v2 r
回復 给力 爆菊

使用道具 舉報

發表於 2013-10-4 09:09:25 | 顯示全部樓層
這個原理不知道。。這個行業水深,大神很多
* u4 e$ N! {% s5 g! ^+ V. ^4 a
回復 给力 爆菊

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 免费注册

本版積分規則

过期高净值品牌域名预定抢注

點基

GMT+8, 2026-2-4 20:10

By DZ X3.5

小黑屋

快速回復 返回頂部 返回列表