Exemplo n.º 1
0
function mok_follow_check()
{
    $head = array('User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.99 Safari/537.36', 'Cookie:BDUSS=' . $_GET['bduss']);
    $opt = unserialize(option::get('mok_follow'));
    foreach ($opt['mustTieba'] as $tb => $lv) {
        $c = new wcurl('http://tieba.baidu.com/mo/m?kw=' . urlencode($tb), $head);
        $t = $c->get();
        $c->close();
        if (textMiddle($t, '&#160;(等级', ')') < $lv) {
            msg($opt['error'][0]);
        }
    }
    if (count($opt['optionTieba']) > 0) {
        $check = false;
        foreach ($opt['optionTieba'] as $tb => $lv) {
            $c = new wcurl('http://tieba.baidu.com/mo/m?kw=' . urlencode($tb), $head);
            $t = $c->get();
            $c->close();
            if (textMiddle($t, '&#160;(等级', ')') >= $lv) {
                $check = true;
                break;
            }
        }
        if ($check == false) {
            msg($opt['error'][0]);
        }
    }
}
Exemplo n.º 2
0
function cron_mok_zdwk()
{
    //如果今天签到过了直接返回日志
    if (option::get('mok_zdwk_run') == date('d')) {
        return option::get('mok_zdwk_log');
    }
    global $m;
    $prefix = DB_PREFIX;
    //选出用户的options和bduss
    $res = $m->query("SELECT {$prefix}users_options.`name` , {$prefix}users_options.`value` , {$prefix}baiduid.`bduss` \nFROM {$prefix}baiduid\nINNER JOIN {$prefix}users_options ON {$prefix}users_options.uid = {$prefix}baiduid.uid\nWHERE {$prefix}users_options.`name` =  'mok_zdwk_wk'\nOR {$prefix}users_options.`name` =  'mok_zdwk_zd'");
    $wk = $zd = 0;
    $bduss = array();
    if ($m->num_rows($res) != 0) {
        while ($row = $res->fetch_array()) {
            //判断该选项是否开启
            if ($row['value'] == 'on') {
                //记录bduss(数量),如果bduss数组内没有该bduss,则加入数组
                if (!in_array($row['bduss'], $bduss)) {
                    $bduss[] = $row['bduss'];
                }
                if ($row['name'] === 'mok_zdwk_wk') {
                    $wk++;
                    $head = array('Accept:*/*', 'Accept-Encoding:gzip, deflate, sdch', 'Accept-Language:zh-CN,zh;q=0.8', 'Connection:keep-alive', 'Host:wenku.baidu.com', 'Referer:http://wenku.baidu.com/task/browse/daily', 'User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36', 'X-Requested-With:XMLHttpRequest');
                    $c = new wcurl('http://wenku.baidu.com/task/submit/signin', $head);
                    $c->addCookie('BDUSS=' . $row['bduss']);
                    $c->exec();
                    $c->close();
                } else {
                    if ($row['name'] === 'mok_zdwk_zd') {
                        $zd++;
                        $c = new wcurl('http://zhidao.baidu.com/');
                        $c->addCookie('BDUSS=' . $row["bduss"]);
                        $stoken = $c->get();
                        $c->close();
                        $stoken = textMiddle($stoken, '"stoken":"', '",');
                        if ($stoken != "") {
                            $c = new wcurl('http://zhidao.baidu.com/submit/user');
                            $c->addCookie('BDUSS=' . $row["bduss"]);
                            $c->post(array('cm' => '100509', 'utdata' => '90,90,102,96,107,101,99,97,96,90,98,103,103,99,127,106,99,99,14138554765830', 'stoken' => $stoken));
                            $c->close();
                        }
                    }
                }
            }
        }
    }
    $log = "知道、文库签到完毕<br/>" . date("Y-m-d H:i:s") . "<br/>共计百度账号: " . count($bduss) . " 个<br/>知道签到: {$zd} 个<br/>文库签到: {$wk} 个";
    option::set('mok_zdwk_run', date('d'));
    option::set('mok_zdwk_log', $log);
    return $log;
}
Exemplo n.º 3
0
/**
 * 获取一个bduss对应的百度用户名
 *
 * @param string $bduss BDUSS
 * @return string|bool 百度用户名,失败返回FALSE
 */
function getBaiduId($bduss)
{
    $c = new wcurl('http://wapp.baidu.com/');
    $c->addCookie(array('BDUSS' => $bduss, 'BAIDUID' => strtoupper(md5(time()))));
    $data = $c->get();
    $c->close();
    return urldecode(textMiddle($data, 'i?un=', '">'));
}
Exemplo n.º 4
0
/**
 * 获取一个bduss对应的百度用户名
 *
 * @param string $bduss BDUSS
 * @return string|bool 百度用户名,失败返回FALSE
 */
function getBaiduId($bduss)
{
    global $m;
    $header[] = 'Content-Type:application/x-www-form-urlencoded; charset=UTF-8';
    $header[] = 'Cookie: BDUSS=' . $bduss;
    $c = new wcurl('http://wapp.baidu.com/', $header);
    $data = $c->get();
    $c->close();
    return urldecode(textMiddle($data, 'i?un=', '">'));
}
Exemplo n.º 5
0
                         msg('错误:您的贴吧数量超过限制,无法刷新!');
                     }
                 }
             }
         }
         Redirect('index.php?mod=showtb&ok');
     }
     doAction('showtb_set');
     break;
 case 'set':
     // 获取头像的url
     if ($i['post']['face_img'] == 1 && $i['post']['face_baiduid'] != '') {
         $c = new wcurl('http://www.baidu.com/p/' . option::uget("face_baiduid"));
         $data = $c->get();
         $c->close();
         $i['post']['face_url'] = stripslashes(textMiddle($data, '<img class=portrait-img src=\\x22', '\\x22>'));
     }
     /*
     受信任的设置项,如果插件要使用系统的API去储存设置,必须通过set_save1或set_save2挂载点挂载设置名
     具体挂载方法为:
     global $PostArray;
     $PostArray[] = '设置名';
     为了兼容旧版本,可以global以后检查一下是不是空变量,为空则为旧版本
     */
     $PostArray = array('face_img', 'face_baiduid', 'face_url');
     doAction('set_save1');
     //更改邮箱
     if ($_POST['mail'] != $i['user']['email'] && !empty($_POST['mail'])) {
         if (checkMail($_POST['mail'])) {
             $mail = sqladds($_POST['mail']);
             $z = $m->once_fetch_array("SELECT COUNT(*) AS total FROM `" . DB_NAME . "`.`" . DB_PREFIX . "users` WHERE email='{$mail}'");
Exemplo n.º 6
0
<?php

require '../../init.php';
if (!defined('SYSTEM_ROOT') || ROLE != 'admin') {
    die('Insufficient Permissions');
}
if (!empty($_POST)) {
    //将贴吧和等级存为数组,吧名为键,等级为值
    $ary = explode("\n", $_POST['mustTieba']);
    $mustTieba = array();
    foreach ($ary as $value) {
        $t = explode(' ', $value);
        if (count($t) == 2) {
            $mustTieba[$t[0]] = textMiddle($t[1], '<', '>');
        }
    }
    $ary = explode("\n", $_POST['optionTieba']);
    $optionTieba = array();
    foreach ($ary as $value) {
        $t = explode(' ', $value);
        if (count($t) == 2) {
            $optionTieba[$t[0]] = textMiddle($t[1], '<', '>');
        }
    }
    $ary = array('mustTieba' => $mustTieba, 'optionTieba' => $optionTieba, 'error' => array($_POST['error']));
    option::set('mok_follow', serialize($ary));
    Redirect('../../index.php');
}