当前位置:Gxlcms > PHP教程 > 海量视频数据,开源网站

海量视频数据,开源网站

时间:2021-07-01 10:21:17 帮助过:5人阅读

56网开放api调用数据,整站开源

演示地址: http://dev.56.com:81/56api/index.php?type=baby


请输入描述 56api_examples.zip (141 K) 下载次数:0

56网开放平台
  1. include("./SDK.php");
  2. $m = new Memcached();
  3. $m->addServer('172.16.245.91', 22222);
  4. $array = array();
  5. $category = new open56Client(APPKEY,APPSECRET);
  6. $cat = isset($_GET['type']) ? trim(strtolower($_GET['type'])) : "today";
  7. $class = array('today'=>1,'ent'=>3,'art'=>4,'tv'=>5,'mtv'=>6,'mm'=>8,'show' => 9,'ori'=>39,'net'=>11,'fun' => 10,'record'=>12,'auto'=>13,'game'=>14,'girl' => 15,'baby'=>16);
  8. if(isset($class[$cat])){
  9. $cid = $class[$cat];
  10. $key = "recommend_video_".$cat;
  11. if(!$array = $m->get($key)){
  12. $array = $category->recommendVideo($cid, $page = '1', $num = '20');
  13. $m->set($key, $array);
  14. }
  15. $recommend_hot = json_decode($array, true);
  16. }
  17. else{
  18. header("location: ./index.php");
  19. exit;
  20. }

人气教程排行