欢迎光临
我们一直在努力

智慧职教云课堂刷评论问答纠错笔记代码

智慧职教云课堂刷评论问答纠错笔记代码

只写了刷三级目录

<?php
/*
 *------------------------------------------------------
 * Title : 职教云刷评论问答笔记纠错PHP版 V2.0
 *------------------------------------------------------
 * Author : qingshan ([email]1808027167@qq.com[/email])
 *------------------------------------------------------
 * Time : 2020-05-25
 *------------------------------------------------------
 * Tips : 本源码不得贩卖
 *------------------------------------------------------
 */
ini_set('max_execution_time','0');
set_time_limit(0);
require_once('conn.php');
error_reporting(0);
$kc=$_GET['course'];
$userName=$_GET['user'];
$userPwd=$_GET['pwd'];
$token=$_GET['token'];
$type=$_GET['type'];
$emit=time()."000";
//echo date('Y-m-d H:i:s');
$equipmentModel="Xiaomi Redmi K20 Pro";
$equipmentApiVersion="10";
$equipmentAppVersion=getver();
$device=getDevice($equipmentModel,$equipmentApiVersion,$equipmentAppVersion,$emit);
$headers = array('Content-Type:'.'application/x-www-form-urlencoded','emit:'.$emit,'device:'.$device);
        
//pe
echo '<title>花前月下网络助手</title><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><body bgcolor="pink"><center>';


$sqls="select * from gf where token = '{$token}' ";
$result=$db->query($sqls);
$result=mysqli_fetch_all($result);
//print_r($result[0]);
if(!isset($result[0])){
    echo "<a href='http://wpa.qq.com/msgrd?v=3&uin=1808027167&site=qq&menu=yes'>请联系客服购买 价格18/月</a>";
}else{


//学生cookie
$cookies=get_teacookie($userName,$userPwd);
//echo $cookies;
//获取courseopenid
$url='https://zjy2.icve.com.cn/api/student/learning/getLearnningCourseList';
$output=curl_get($url,$headers,$data,$cookies); 
//print_r($output);
echo "<script>alert('点一下即可开始刷评论!然后请等待加载完毕!');</script>";
if(isset($kc)){
    echo "<h2 style='color:red'>Success!</h2>";
}
echo "<h3>注意:课件多的由于是PHP执行就很慢,请等待执行完毕再退出浏览器!</h3>";
$courselist=$output['courseList'];
if(isset($output['courseList'])){
    foreach ($output['courseList'] as $cousexh=>$course){
        echo "课程:".$course['courseName']."<a href='spl.php?user={$userName}&pwd={$userPwd}&token={$token}&course={$cousexh}&type={$type}'>点我刷该科</a><br><br>";  
    };
}else{
        echo "账号密码错误or密码带有特殊字符请修改"; 
        }



$url = "https://zjy2.icve.com.cn/api/study/process/getProcessList";
$data = array("courseOpenId"=>$output['courseList'][$kc]['courseOpenId'],"openClassId"=>$output['courseList'][$kc]['openClassId']);
$output=curl_post($url,$headers,$data,$cookies); 
//print_r($output);

$mulu1s = $output['progress']['moduleList'];
//print_r($mulu1s);

foreach($mulu1s as $mulu1xh=>$mulu1){
    //echo $mulu1['name']."<br>";
    $url = "https://zjy2.icve.com.cn/api/study/process/getTopicByModuleId";
    $data = array("courseOpenId"=>$courselist[$kc]['courseOpenId'],"moduleId"=>$mulu1['id']);
    $output=curl_post($url,$headers,$data,$cookies); 
    //print_r($output);
    $mulu2s = $output['topicList'];
    foreach ($mulu2s as $mulu2xh=>$mulu2){
        //echo $mulu2['name']."<br>";
        $url = "https://zjy2.icve.com.cn/api/study/process/getCellByTopicId";
        $data = array("courseOpenId"=>$courselist[$kc]['courseOpenId'],"openClassId"=>$courselist[$kc]['openClassId'],"topicId"=>$mulu2['id']);
        $output=curl_post($url,$headers,$data,$cookies); 
        //print_r($output);
        $mulu3s = $output['cellList'];
       
         foreach ($mulu3s as $mulu3xh=>$mulu3){
           // echo $mulu3['name']."<br>";
            $url = "https://zjy2.icve.com.cn/api/common/Directory/addCellActivity";
            if($type != 1){
                $star=0;
            }else{
                $star=5;
            }
            $data = array("courseOpenId"=>$courselist[$kc]['courseOpenId'],"openClassId"=>$courselist[$kc]['openClassId'],"cellId"=>$mulu3['Id'],"activityType"=>$type,"docJson"=>"","content"=>"无","star"=>$star);
           $output=curl_post($url,$headers,$data,$cookies);
             //print_r($output);
             sleep(5);
            
         }
    }
}














}
/*
**核心方法 请勿更改
**POST/GET
**GETCOOKIE
*/

function get_teacookie($username,$userpwd){
$emit=time()."000";
//echo date('Y-m-d H:i:s');
$equipmentModel="Xiaomi Redmi K20 Pro";
$equipmentApiVersion="10";
$equipmentAppVersion=getver();
$device=getDevice($equipmentModel,$equipmentApiVersion,$equipmentAppVersion,$emit);
//echo "<pre>";
//header        
$header = array('Content-Type:'.'application/x-www-form-urlencoded','emit:'.$emit,'device:'.$device);       
//print_r($header);

//login                
$url="https://zjyapp.icve.com.cn/newMobileAPI/MobileLogin/newSignIn";
$data=array("clientId"=>"d902c875d5f34c0f93362139f5af0c4c","sourceType"=>"2","userPwd"=>$userpwd,"userName"=>$username,"appVersion"=>$equipmentAppVersion,"equipmentAppVersion"=>$equipmentAppVersion,"equipmentApiVersion"=>$equipmentApiVersion,"equipmentModel"=>$equipmentModel);
//print_r($data);
$output=httppost($url,$header,$data);
//print_r($output);;
// 解析HTTP数据流
list($header, $body) = explode("\r\n\r\n", $output);
//print_r($header);
// 解析COOKIE
preg_match_all("/set\-cookie:([^\r\n]*)/i", $header, $matches);
//请求的时候headers 带上cookie就可以了
//print_r($matches);
$cookies=explode(';', $matches[1][1]);
//print_r($cookies);
$cookie = $cookies['0'];
return $cookie;
}

function httppost($url,$headers,$data){
                $curl=curl_init();
                curl_setopt($curl, CURLOPT_URL, $url);
                curl_setopt($curl, CURLOPT_HEADER, 1); 
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); 
        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE); 
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl,CURLOPT_HTTPHEADER,$headers);
                
                curl_setopt($curl, CURLOPT_POST, 1);
                        
        curl_setopt($curl, CURLOPT_POSTFIELDS,http_build_query($data));
                
        $output = curl_exec($curl);
                
        curl_close($curl);
                //$output=json_decode($output,true);
        return $output;
                //print_r($output);
} 

function curl_get($url,$headers,$data,$cookie){
                $curl=curl_init();
                curl_setopt($curl, CURLOPT_URL, $url);
                curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); 
        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE); 
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl,CURLOPT_HTTPHEADER,$headers);
                curl_setopt($curl,CURLOPT_COOKIE,$cookie);
                //curl_setopt($curl, CURLOPT_POST, 1);
                
        //curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
                
        $output = curl_exec($curl);
                
        curl_close($curl);
                $output=json_decode($output,true);
        return $output;
                //print_r($output);
}

function curl_post($url,$headers,$data,$cookie){
                $curl=curl_init();
                curl_setopt($curl, CURLOPT_URL, $url);
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); 
        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE); 
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl,CURLOPT_HTTPHEADER,$headers);
                curl_setopt($curl,CURLOPT_COOKIE,$cookie);
                curl_setopt($curl, CURLOPT_POST, 1);
                
        curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));
                
        $output = curl_exec($curl);
                
        curl_close($curl);
                $output=json_decode($output,true);
        return $output;
                //print_r($output);
}






function post_curl($url, $params=[], $headers=[]){   
    $httpInfo = array();   
    $ch = curl_init();      
    curl_setopt($ch, CURLOPT_HEADER, 1);   
    curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
    curl_setopt( $ch, CURLOPT_HTTP_VERSION , CURL_HTTP_VERSION_1_1 );   
    curl_setopt( $ch, CURLOPT_USERAGENT , 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36' );   
    curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT , 30 );   
    curl_setopt( $ch, CURLOPT_TIMEOUT , 30);   
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER , true );      
    curl_setopt( $ch , CURLOPT_POST , true );   
    curl_setopt( $ch , CURLOPT_POSTFIELDS , http_build_query($params));   
    curl_setopt( $ch , CURLOPT_URL , $url );        
    $response = curl_exec( $ch );   
    if ($response === FALSE) {      
        return false;   
        
    }        
    curl_close( $ch );    
    return $response;
    
}
//
function object_array($array) {  
    if(is_object($array)) {  
        $array = (array)$array;  
     } if(is_array($array)) {  
         foreach($array as $key=>$value) {  
             $array[$key] = object_array($value);  
             }  
     }  
     return $array;  
}

function getDevice($model,$vsersionAndroid,$versionName,$timeStamp){
    $tmp=md5($model);
    //echo $tmp."<br>";
    $tmp1=$tmp.$vsersionAndroid;
    //echo $tmp."<br>";
    $tmp=md5($tmp1);
    //echo $tmp."<br>";
    $tmp1=$tmp.$versionName;
    //echo $tmp."<br>";
    $tmp=md5($tmp1);
    //echo $tmp."<br>";
    $tmp1=$tmp.$timeStamp;
    //echo $tmp."<br>";
    return md5($tmp1);
}

function getver(){
    $url="https://zjy2.icve.com.cn/portal/AppVersion/getLatestVersionInfo";
    $output = file_get_contents($url);
    $version = json_decode($output,true)['appVersionInfo']['VersionCode'];
    return $version;
}

赞(0)
未经允许不得转载:阿强爱分享 » 智慧职教云课堂刷评论问答纠错笔记代码

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址