php提取osc最近发动弹的人 无 ?php/* @Author 70(781787584) * @Url http://www.mlrzw.cn */set_time_limit(0);header("Content-Type: text/html;charset=utf-8");for ($i = 0; $i 300; $i++) {$url = 'http://www.oschina.net/fetch_tweets?p='.$i;$ch = cur
php提取osc最近发动弹的人
<?php /* @Author 70(781787584) * @Url http://www.mlrzw.cn */ set_time_limit(0); header("Content-Type: text/html;charset=utf-8"); for ($i = 0; $i < 300; $i++) { $url = 'http://www.oschina.net/fetch_tweets?p='.$i; $ch = curl_init (); curl_setopt ( $ch, CURLOPT_URL, $url ); curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, true ); curl_setopt ( $ch, CURLOPT_TIMEOUT, 10 ); curl_setopt ( $ch, CURLOPT_REFERER, '' ); $html = curl_exec ( $ch ); $curl_err = curl_errno ( $ch ); $curl_info = curl_getinfo ( $ch ); curl_close ( $ch ); $pattern = '/'.preg_quote(' title="','/').'(.*?)'.preg_quote('" class="SmallPortrait','/').'/i'; preg_match_all( $pattern,$html, $result ); if ($result[1]) { $str = implode(' @', $result[1]); file_put_contents("osc.txt", ' @'.$str , FILE_APPEND); } }