hostloc的php刷分脚本

<?php
function login_post($url, $cookie, $post) {
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post));
curl_exec($curl);
curl_close($curl);

}
function get_content($url, $cookie) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
$rs = curl_exec($ch);
curl_close($ch);
return $rs;
}
$post = array(
‘mod’ => ‘logging’,
‘action’ => ‘login’,
‘loginsubmit’ => ‘yes’,
‘infloat’ => ‘yes’,
‘lssubmit’ => ‘yes’,
‘username’ => ‘Ricky.D.’,
‘password’ => ‘密码啊’
);
$url = “http://www.hostloc.com/member.php”;
$cookie = dirname(__FILE__) . ‘/cookie_lochost.txt’;
login_post($url, $cookie, $post);
for ($i = 0; $i <= 12; $i++) {
$url2 = “http://www.hostloc.com/space-uid-” . rand(10000, 25000) . “.html”;
$content = get_content($url2, $cookie);
echo $content;
}
?>

 

建议放到服务器然后crontab php执行即可

说点什么

您将是第一位评论人!

avatar
  Subscribe  
提醒