MENU

利用PHP实现hostloc刷分脚本

• December 8, 2017 • Read: 156 • 瞎折腾,PHP

IMG_3512.PNG

原理:

通过访问别人的空间而增加积分的 周期最多加10次 一次加2金钱 一天最多20金钱


代码:

<?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' => '账号',
    '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;
}
?>

建议大家直接放在vps上用crontab定时执行:

01 0 * * * php /root/filename.php
Tags: None
Archives QR Code
QR Code for this page
Tipping QR Code