找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 4021|回复: 45

[iptv信源 资源分享或寻求] 云课堂系列(5)---广州全年级共享课堂.PHP

  [复制链接]
发表于 2022-9-4 11:40 | 显示全部楼层 |阅读模式
云课堂系列(5)出炉,欢迎测试学习,若有不足之处,感谢指正~~~

云课堂系列详见:
1.上海空中课堂PHP  https://www.right.com.cn/forum/thread-8247811-1-1.html
2.北京空中课堂PHP  https://www.right.com.cn/forum/thread-8248610-1-1.html
3.云课堂系列(3)---天津初高中精品课程.PHP  https://www.right.com.cn/forum/thread-8252473-1-1.html
4.云课堂系列(4)---江苏高中名师优课.PHP    https://www.right.com.cn/forum/thread-8252479-1-1.html

广州共享课堂代理测试:
指定课程:学习仿写,http://mmitv.top/test/gzykt.php? ... id=second&type=初八语文第一单元
随机学习高一化学一节课程,http://mmitv.top/test/gzykt.php? ... =second&type=hx


PHP完整代码及食用方法回复可见:
  1. <?php
  2. /****************************************
  3. 食用方法:
  4. 随机学习高一数学一节课程:http://xxxxx/gzykt.php?id=&gid=951&sid=rand&type=sx
  5. 获取初三英语第二学期课程列表:http://xxxxx/gzykt.php?id=list&gid=824&sid=second&type=yyu

  6. 参数修改根据数组$grade和$sub和$ster的元素值自行组合即可。
  7. *****************************************/
  8. $id = isset($_GET['id'])?$_GET['id']:'list';
  9. $gid = isset($_GET['gid'])?$_GET['gid']:'951';//年级,$grade数组定义的值进行替换
  10. $sid = isset($_GET['sid'])?$_GET['sid']:'second';//学期,$ster数组定义的值进行替换
  11. $type= isset($_GET['type'])?$_GET['type']:'sx';//科目,$sub数组定义的值进行替换
  12. $ster=array(
  13.     'zero'=>'2',//第一二学期
  14.     'first'=>'0',//第一学期
  15.     'second'=>'1',//第二学期
  16.     );
  17. $sub=array(
  18.     'yw'=>'语文',
  19.     'sx'=>'数学',
  20.     'yyu'=>'英语',
  21.     'wl'=>'物理',
  22.     'hx'=>'化学',
  23.     'ls'=>'历史',
  24.     'dl'=>'地理',
  25.     'swx'=>'生物学',
  26.     'sxzz'=>'思想政治',
  27.     'ddyfz'=>'道德与法治',
  28.     'kx'=>'科学',
  29.     'yyue'=>'音乐',
  30.     'ms'=>'美术',
  31.     'tyyjk'=>'体育与健康',
  32.     'zhsjhd'=>'综合实践活动',
  33.     'xljkjy'=>'心理健康教育',
  34.     'jttydl'=>'家庭体育锻炼',
  35.     'jtjy'=>'家庭教育',
  36.     'xxjs'=>'信息技术',
  37.     'tyjs'=>'通用技术',
  38.     );
  39. $grade=array(
  40.     1029=>'小一',
  41.     105 =>'小二',
  42.     204 =>'小三',
  43.     286 =>'小四',
  44.     402 =>'小五',
  45.     511 =>'小六',
  46.     625 =>'初七',
  47.     713 =>'初八',
  48.     824 =>'初九',
  49.     951 =>'高一',
  50.     989 =>'高二',
  51.     );
  52. if(empty($ster[$sid])||$sid=='rand'){
  53.     $sid=array_keys($ster)[array_rand(array_keys($ster),1)];  
  54.   }   
  55. if(empty($sub[$type])||$type=='rand'){
  56.     $type=array_keys($sub)[array_rand(array_keys($sub),1)];  
  57.   }
  58. if(empty($grade[$gid])||$gid=='rand'){
  59.     $gid=array_keys($grade)[array_rand(array_keys($grade),1)];  
  60.   }
  61. $header=array(
  62.     'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',
  63.     'Referer: https://gzclass.gztv.com/gksubjecpc/',
  64.     "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36",
  65.   );
  66. if($id=='list'||$id==''){  
  67. $url='https://gzclass.gztv.com/hcEdu/pc/getGradeData?topColumnId='.$gid;
  68. $info=json_decode(get_data($url,$header));
  69. foreach ($info->data as $column){
  70.   if($column->columnName==$sub[$type]){
  71.     if($ster[$sid]==0||$ster[$sid]==2){  
  72.       foreach ($column->children[0]->children as $unit){
  73.         $Chapter=$unit->columnName;
  74.         foreach ($unit->courseList as $course){
  75.           $coursename=$course->courseName;
  76.           $uuid=$uids[]=$course->uuid;
  77.           if($id=='list'){
  78.             echo $coursename.',http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?id='.$uuid.'&sid=first&type='.$grade[$gid].$sub[$type].$Chapter.'</a><br>';
  79.           }  
  80.         }
  81.       }
  82.     }
  83.     if($ster[$sid]==1||$ster[$sid]==2){
  84.       foreach ($column->children[1]->children as $unit){
  85.         $Chapter=$unit->columnName;
  86.         foreach ($unit->courseList as $course){
  87.           $coursename=$course->courseName;
  88.           $uuid=$uids[]=$course->uuid;
  89.           if($id=='list'){
  90.             echo $coursename.',http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?id='.$uuid.'&sid=second&type='.$grade[$gid].$sub[$type].$Chapter.'</a><br>';
  91.           }  
  92.         }
  93.       }
  94.     }  
  95.   }
  96. }
  97.   if(!$uuid){
  98.     echo '无数据,获取课程列表失败!';
  99.   }  
  100.   if($uuid&&$id==null){
  101.     $id=$uids[array_rand($uids,1)] ;
  102.   }
  103. }
  104. if($id!=='list'&&$id!==null){
  105.   $url= 'https://gzclass.gztv.com/hcEdu/pc/getLessons?courseId='.$id;
  106.   $info=json_decode(get_data($url,$header));
  107.   $lesson=$info->data->list[0];
  108.   $name=$lesson->lessonName;
  109.   $gradeSubject=$lesson->gradeSubject;
  110.   $title=$lesson->answers[0]->title;
  111.   if($id&&$info){
  112.     $lessonurl=$lesson->lessonLink.'?tag='.$name.'&type='.$gradeSubject;
  113.     $videourl=$lesson->answers[0]->videoLink.'?tag='.$title.'&type='.$gradeSubject;
  114.     if($title){
  115.        $playurl=str_replace('https','http',array($lessonurl,$videourl)[mt_rand(0,1)]);
  116.     }else{
  117.        $playurl=str_replace('https','http',$lessonurl);
  118.     }
  119.   }
  120.   //print_r($playurl);
  121.   header('location:'.$playurl);
  122. }

  123. function get_data($url,$header,$post=null){
  124. $ch = curl_init();
  125. curl_setopt($ch, CURLOPT_URL, $url);
  126. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  127. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  128. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
  129. if(!empty($post)){
  130.   curl_setopt($ch, CURLOPT_POST, 1);
  131.   curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  132.   }
  133. curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
  134. $data = curl_exec($ch);
  135. curl_close($ch);
  136. return $data;
  137. }

复制代码

提供附件,免回复下载:


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
发表于 2022-9-4 11:55 | 显示全部楼层
感谢分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-4 12:25 | 显示全部楼层
食用方法回复可
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-4 12:26 | 显示全部楼层
感谢分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-4 12:45 来自手机 | 显示全部楼层
云课堂系列(
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-4 13:28 | 显示全部楼层
谢谢分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-4 13:29 | 显示全部楼层
感谢你的分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-4 13:43 | 显示全部楼层

感谢分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-4 13:47 来自手机 | 显示全部楼层
感谢分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-4 13:50 来自手机 | 显示全部楼层
看看........
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-4 14:19 | 显示全部楼层
来个全套,牛
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-4 14:20 | 显示全部楼层
-广州全年级共享课堂.PHP
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-4 15:21 | 显示全部楼层
谢谢分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-4 15:53 | 显示全部楼层
看看是什么
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-4 16:44 | 显示全部楼层

感谢分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-25 12:52

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表