56.com opens API call data, and the entire site is open source
Demo address:
http://dev.56.com:81/56api/index.php?type=baby
Please enter a description 56api_examples.zip (141 K) Number of downloads: 0
56 Network Open Platform
- include("./SDK.php");
-
- $m = new Memcached();
- $m->addServer('172.16.245.91', 22222);
-
- $array = array() ;
- $category = new open56Client(APPKEY,APPSECRET);
-
- $cat = isset($_GET['type']) ? trim(strtolower($_GET['type'])) : "today";
-
- $ 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);
-
- if(isset($class[$cat])){
- $cid = $class[$cat] ;
- $key = "recommend_video_".$cat;
-
- if(!$array = $m->get($key)){
- $array = $category->recommendVideo($cid, $page = ' 1', $num = '20');
- $m->set($key, $array);
- }
- $recommend_hot = json_decode($array, true);
- }
- else{
- header("location : ./index.php");
- exit;
- }
Copy code
|