找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 2367|回复: 26

[iptv信源 资源分享或寻求] 云课堂系列(3)---天津初高中精品课程.PHP

[复制链接]
发表于 2022-9-4 10:25 | 显示全部楼层 |阅读模式
本帖最后由 jiteloozz 于 2022-9-4 11:43 编辑

云课堂系列(3)出炉,欢迎测试学习,若有不足之处,感谢指正~~~


云课堂系列详见:
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
5.云课堂系列(5)---广州全年级共享课堂.PHP  https://www.right.com.cn/forum/thread-8252487-1-1.html

代理测试:
第5课时 微型课5 解一元二次方程(4),http://mmitv.top/test/tjykt.php? ... 0&gid=9&sid=13&tag=初九第二学期
随机学习高一一节课程:http://mmitv.top/test/tjykt.php?id=&gid=10&sid=13




PHP完整代码及食用方法回复可见:
  1. <?php
  2. /***********************
  3. 随机学习高一第一学期一节课程:http://XXXXX/tjykt.php?id=&gid=10&sid=12
  4. 获取高一第二学期全部课程列表:http://XXXXX/tjykt.php?id=list&gid=10&sid=13
  5. 其他课程参数根据数组$gids和$sids的元素值自行修改即可。
  6. ***********************/
  7. $id = isset($_GET['id'])?$_GET['id']:'list';
  8. $gid = isset($_GET['gid'])?$_GET['gid']:'10';
  9. $sid = isset($_GET['sid'])?$_GET['sid']:'13';
  10. $sids=array(
  11.     12=>'第一学期',
  12.     13=>'第二学期',
  13.    );
  14. $gids=array(
  15.     7=>'初七',//216211151,214699748
  16.     8=>'初八',//216211154,214699761
  17.     9=>'初九',//222659011,214699769
  18.     10=>'高一',//216211134,214713773
  19.     11=>'高二',//222635813,214713796
  20.     12=>'高三',//222659369,214713826
  21.     );
  22. if(empty($gids[$gid])||$gid=='rand'){
  23.   $gid=array_keys($gids)[array_rand(array_keys($gids),1)];  
  24.   }
  25. if(empty($sids[$sid])||$sid=='rand'){
  26.   $sid=array_keys($sids)[array_rand(array_keys($sids),1)];  
  27.   }
  28. $header=array(
  29.     'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',
  30.     'Referer: http://mooc1.chaoxing.com/',
  31.     "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",
  32.   );
  33. $headers=stream_context_create(['http'=>['header'=>$header]]);  
  34. if($id=='list'||$id==''){
  35.   $phase=3;
  36.   if($gid<=9){
  37.   $phase=2;
  38.   }
  39.   $url='http://tjedu.tjjy.com.cn/api/erqi/course/datas';
  40.   $post='phase='.$phase.'&grade='.$gid.'&subject=&colType='.$sid.'&code=&orderby=time&curPage=1&pageSize=9';
  41.   $info=json_decode(get_data($url,$header,$post));   
  42.   $moocUrl=$info->data->list[0]->moocUrl;
  43.   $str=file_get_contents($moocUrl,false,$headers);
  44.   preg_match_all('/href="(\/nodedetailcontroller\/.*?)">/',$str,$urls);
  45.   preg_match_all('/break-word;">(.*?\d.*?)</',$str,$title);
  46.   if($id=='list'){
  47.     $result=str_replace(['/nodedetailcontroller/visitnodedetail','courseId','knowledgeId'],['','cid','id'],$urls[1]);  
  48.     $n=count($title[1]);  
  49.     for($m=0;$m<$n;$m++){  
  50.     echo $title[1][$m].',http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].$result[$m].'&gid='.$gid.'&sid='.$sid.'&tag='.$gids[$gid].$sids[$sid].'</a><br>';
  51.     }  
  52.   }
  53.   if($id==null){
  54.   $pam=$urls[1][array_rand($urls[1],1)];  
  55.   }
  56. }
  57. if($id!=='list'&&$id!==''){
  58.   $cid = isset($_GET['cid'])?$_GET['cid']:'214713773';
  59.   if(!empty($cid)){
  60.   $pam='/nodedetailcontroller/visitnodedetail?courseId='.$cid.'&knowledgeId='.$id;
  61.   }
  62. }
  63. if($pam){
  64.   $newurl='http://mooc1.chaoxing.com'.$pam;
  65.   $str=file_get_contents($newurl,false,$headers);
  66.   preg_match('/objectid":"(.*?)",/',$str,$data);
  67.   if($data){
  68.   $strurl='http://mooc1.chaoxing.com/ananas/status/'.$data[1].'?k=1467&flag=normal';
  69.   $http=json_decode(get_data($strurl,$header))->http;
  70.   $playurl=str_replace('s1.','s3.',$http);
  71.   //print_r($playurl);
  72.   header('location:'.$playurl);
  73.   }
  74. }

  75. function get_data($url,$header,$post=null){
  76. $ch = curl_init();
  77. curl_setopt($ch, CURLOPT_URL, $url);
  78. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  79. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  80. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
  81. if(!empty($post)){
  82.   curl_setopt($ch, CURLOPT_POST, 1);
  83.   curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  84.   }
  85. curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
  86. $data = curl_exec($ch);
  87. curl_close($ch);
  88. return $data;
  89. }
复制代码

提供附件,免回复下载:



本帖子中包含更多资源

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

×
我的恩山、我的无线 The best wifi forum is right here.
发表于 2022-9-4 10:51 | 显示全部楼层
看看怎么样
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-4 11:11 | 显示全部楼层
宣传方式的方式
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

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

使用道具 举报

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

使用道具 举报

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

使用道具 举报

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

使用道具 举报

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

使用道具 举报

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

使用道具 举报

发表于 2022-9-4 18:52 | 显示全部楼层
天津初高中精品课程
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

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

使用道具 举报

发表于 2022-9-4 21:37 | 显示全部楼层
天津初高中精品课程.PHP
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-5 11:07 | 显示全部楼层
PHP完整代码及食用方法回复可见
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-16 16:34 | 显示全部楼层
谢谢大神的分享,看看如何使用。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-23 12:16 | 显示全部楼层
PHP完整代码及食用方法回复可见:
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-3-29 09:35

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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

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