<?php set_time_limit(0); require_once 'PostHttp.class.php'; echo "piao.php?id=8&total=10000<br>"; $id = $_GET['id']; $total = $_GET['total']; $postData['handlekey'] = "pollresult"; $postData['id'] = "1"; $postData['formhash'] = "aab37902"; $postData['choose_value'] = $id; $postURL = "http://www.yyfs.cc/plus/poll.php?action=choose"; $http = new PostHttp(); if ($_GET['begin'] == 1) { for ($i = 0; $i < $total; $i++) { $http->clearFields(); $http->setReferer('http://www.yyfs.cc/plus/poll.php?id=1'); foreach ($postData as $key => $val) { $http->addField($key, $val); } sleep(1); $http->postPage($postURL); echo "posted: {$i}<br>"; ob_flush(); flush(); } }
} else { $r[$key][$site][$v] = parse_html($tmp); //$r[引擎类型][主站][搜索url] } ob_flush(); flush(); echo $v . " ======== " . $r[$key][$site][$v] . "<br>"; sleep(3); //抓取间隔5s } } } $postData['time'] = strtotime('last day'); $postData['data'] = base64_encode(serialize($r)); $postURL = "http://tongji.tootoo.com/cron/api_receive_records.php"; $http = new PostHttp(); $http->clearFields(); foreach ($postData as $key => $val) { $http->addField($key, $val); } $http->postPage($postURL); $strPostResult = $http->getContent(); var_dump($strPostResult); //------------------------------------------------------------------- function get_sources($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERAGENT, isset($_SERVER['HTTP_USER_AGENT']) ? trim($_SERVER['HTTP_USER_AGENT']) : 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1'); curl_setopt($ch, CURLOPT_REFERER, 'http://www.google.com/'); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
<?php //$sr = 'http://pic.hellocache.com/2010/03/31/m/1148621910/f092a9a5e03f089149e3d70ea9559afd-1270013381.jpg'; //$s = pathinfo($sr); //var_dump($s); require_once 'PostHttp.class.php'; set_time_limit(0); //error_reporting(0); $c_str = 'lang=zh; time_zone=Asia%2FShanghai; fav_secure=FbUDgQmtnRZinNe4294K1wU%2B0eidTxf%2FKKCPIlsiqVnLheFjVl6Phe365xjOflvLU%2FqptT1%2FZ1KcpkK71gT0Lkbp55DA0zfzS9ZeU5C9%2Bx2rb42k%2FAoW7Dvubigc%2FfdnDXOJV2vQQAX8ysdsYhEqYaHRXQ97RMJRPmCFZ%2F0iFePZwyG6FLOytOy%2FfXGD4%2Bj%2Bsuu7EK%2FpkCs%3D; __utma=169688886.571695815.1276247547.1276394233.1276400706.5; __utmz=169688886.1276247547.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); lzstat_uv=2735514327635723467|1283235; lzstat_ss=2385774387_9_1276429673_1283235; __utmc=169688886; __utmb=169688886.10.10.1276400706; pinnum=56707c73973bec80087e4aa2f72ec53b97d51b38; user_id=10887; user_email=leek1984%40qq.com; user_nickname=kilerall; user_profile=kiler; user_role=user; user_secure=P6zWj1vmA9m5gy%2B45NrB25DbcSNARs8z%2FADNdgqAtjBFUB%2F2ZqZU1CTUK0CS0RJN3fPgI5Z468QUS%2BF0Jkd1rA%3D%3D; action_time=1276400898'; $http = new PostHttp(); $http->show_debug = 1; $http->clearFields(); $cc = $http->getCookies($c_str); var_dump($cc); exit; $count = get_max_pages('http://favefavefave.com/tag/xixi like'); echo $count; function get_max_pages($url) { global $http; //$tmp = file_get_contents($url); $http->postPage($url); $tmp = $http->getContent(); if (!$tmp) { return false; } $pattern = "|<a href=\"{$url}/page/(\\d+)\" title=\"Last\">...</a>|i"; $row = array(); if (!preg_match($pattern, $tmp, $row)) { $pattern = "|<div class=\"pages\">.*?<a href=\"{$url}/page/(\\d)\">\\d</a>\\s</div>|is"; preg_match($pattern, $tmp, $row);
<?php header("Content-type:text/html; Charset:utf8"); require_once 'PostHttp.class.php'; set_time_limit(0); //error_reporting(0); $http = new PostHttp(); $http->clearFields(); $url = get_big_pic('http://favefavefave.com/view/13146'); //my_copy($url, 'aaa.jpg'); //my_copy('http://pic.hellocache.com/2010/06/03/m/1184507678/4717ecb6bbf33f8156b54a90b392270f-1275556274.jpg', 'vv.jpg'); function get_big_pic($url) { global $http; //$tmp = file_get_contents($url); $http->postPage($url); $tmp = $http->getContent(); if (!$tmp) { return false; } $pattern = '|<div class="forme" id="view">.*?<p style="text-align:center;"><img src="(.*?)" alt=".*?" /></p>.*?via:\\s*?<a href="(.*?)">(.*?)</a>.*?</div>|is'; preg_match($pattern, $tmp, $row); array_shift($row); var_dump($row); //return $row[1]; } function my_copy($source, $dest) { /* $res = @copy($source, $dest); if( $res ) {
} return $code; } for ($i = 0; $i < 5; $i++) { $e = generateCode(10); $e .= '@'; $stmp = array('qq', '126', 'hotmail', 'sina', 'gmail', '163', 'tom', 'maidezhi'); $len = count($stmp) - 1; $e .= $stmp[mt_rand(0, $len)]; $e .= '.com'; $postData['author'] = $e; $postData['mail'] = $e; $postData['text'] = 'test'; //$postData['confirm_password'] = '******'; $postURL = "http://tension.name/2009/2012/comment"; $http = new PostHttp(); $http->clearFields(); foreach ($postData as $key => $val) { $http->addField($key, $val); } $http->postPage($postURL); //$strPostResult = $http->getContent(); //echo $strPostResult.'<br />'; echo "<br />##email:" . $e; /* $cookie_jar = dirname(__FILE__).'/cookie.txt'; $p = '123456'; $data = 'act=act_register&email='.$e.'&password='******'&confirm_password='.$p; $ch = curl_init();