2012-07-25 20:26:37 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Author Arslan Hassan
|
|
|
|
* @Since v3.0 - 2012
|
|
|
|
*
|
|
|
|
* New Api for ClipBucket to let other application access data
|
|
|
|
*/
|
|
|
|
|
|
|
|
include('../includes/config.inc.php');
|
|
|
|
|
2012-07-26 11:31:51 +00:00
|
|
|
$request = $_REQUEST;
|
|
|
|
$mode = $request['mode'];
|
|
|
|
|
2012-07-25 20:26:37 +00:00
|
|
|
$max_video_limit = 20;
|
|
|
|
|
|
|
|
switch($mode)
|
|
|
|
{
|
|
|
|
case "getVideos":
|
|
|
|
case "get_videos":
|
|
|
|
default:
|
|
|
|
{
|
2012-07-26 11:31:51 +00:00
|
|
|
if($request['limit'] > $max_video_limit || !$request['limit'])
|
|
|
|
$request['limit'] = $max_video_limit;
|
2012-07-25 20:26:37 +00:00
|
|
|
|
2012-07-26 11:31:51 +00:00
|
|
|
$videos = $cbvid->get_videos($request);
|
2012-07-25 20:26:37 +00:00
|
|
|
|
2012-07-26 21:13:35 +00:00
|
|
|
$new_videos = array();
|
|
|
|
if($videos)
|
|
|
|
foreach($videos as $video)
|
|
|
|
{
|
|
|
|
$video['thumbs'] = array('default'=>THUMBS_URL.'/default.jpg');
|
2012-07-30 20:29:38 +00:00
|
|
|
$video['videos'] = array('mobile' => VIDEOS_URL.'/12345.mp4');
|
2012-07-26 21:13:35 +00:00
|
|
|
$new_videos[] = $video;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
echo json_encode($new_videos);
|
2012-07-25 20:26:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|