Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (file_exists('./cache/cache_yt/'.$query.'.gz'))
- {
- $apiurl='./cache/cache_yt/'.$query;
- //$getapi = file_get_contents('compress.zlib://'.$apiurl);
- $getapi = file_get_contents($apiurl);
- }
- else
- {
- $apiurl="https://www.googleapis.com/youtube/v3/search?part=snippet&q=".$query."&type=video&maxResults=30&key=".$youtube_api;
- $getapi = file_get_contents($apiurl);
- if(!empty($getapi))
- {
- if ($cache_enable!='false')
- //gzwrite(gzopen('./cache/cache_yt/'.$query.'.gz',w9),$getapi);
- file_put_contents('./cache/cache_yt/'.$query,$getapi);
- }
- }
- $apidecode =json_decode($getapi, true);
- foreach ($apidecode['items'] as $items) {
- $title = $items['snippet']['title'];
- $desc = $items['snippet']['description'];
- $videoid = $items['id']['videoId'];
- $likes = mt_rand(25000,40000);
- $downloaded = mt_rand($likes,40000);
- $played = mt_rand($downloaded,45000);
- $viewed = mt_rand($played,50000);
- echo '
- <div class="col-sm-12">
- <div style="background-color: #F5F7FC;border: dotted 1px #D2D2CF;padding: 5px; overflow: auto;">
- <div style="margin-left:5px">
- <a target="_blank" style="text-align:left;display:block;" href="http://'.$_SERVER['HTTP_HOST'].'/'.$dl_permalink.'/'.clean$
- <!--<img height=90px width=120px align="left" src="http://img.youtube.com/vi/'.$videoid.'/default.jpg"></img>-->
- '.$title.'
- </a>
- </div>
- <div style="margin-left:5px; text-align:left;">
- Bitrate : <b>256kbps</b> Likes : <b>'.$likes.'</b> Downloaded : <b>'.$downloaded.'</b> Played : <b>'.$played.'</b> Views :$
- <a href="http://'.$_SERVER['HTTP_HOST'].'/'.$dl_permalink.'/'.cleanPermalink($title).'?v='.$videoid.'" style="text-align:l$
- </div>
- </div>
- <br>
- </div>
- ';
- }
- //end youtube grabber
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement