baymin

hostloc刷积分代码
在 /var/www/html/ 目录下创建 loc.php 文件<?php function login_...
扫描右侧二维码阅读全文
02
2018/03

hostloc刷积分代码

在 /var/www/html/ 目录下创建 loc.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' => '账号',
    '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, 24000) . ".html";
    $content = get_content($url2, $cookie);
    echo $content;
}
?>

添加定时任务

crontab -e  
##设置每天晚上10点半自动运行并输出日志
30 22 * * * /usr/bin/php -f /var/www/html/loc.php >> /var/www/html/loc.log  

来源:非常简单的PHP自动刷hostloc积分代码

Last modification:March 4th, 2018 at 03:25 pm
If you think my article is useful to you, please feel free to appreciate

Leave a Comment