Advertisement
rinaldohack

Untitled

Oct 3rd, 2016
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.68 KB | None | 0 0
  1.                                                 if (file_exists('./cache/cache_yt/'.$query.'.gz'))
  2.                                                         {
  3.                                                                 $apiurl='./cache/cache_yt/'.$query;
  4.                                                                 //$getapi = file_get_contents('compress.zlib://'.$apiurl);
  5.                                                                 $getapi = file_get_contents($apiurl);
  6.                                                         }
  7.                                                         else
  8.                                                         {
  9.                                                                 $apiurl="https://www.googleapis.com/youtube/v3/search?part=snippet&q=".$query."&type=video&maxResults=30&key=".$youtube_api;
  10.                                                                 $getapi = file_get_contents($apiurl);
  11.                                                                 if(!empty($getapi))
  12.                                                                 {
  13.                                                                 if ($cache_enable!='false')
  14.                                                                         //gzwrite(gzopen('./cache/cache_yt/'.$query.'.gz',w9),$getapi);
  15.                                                                         file_put_contents('./cache/cache_yt/'.$query,$getapi);
  16.                                                                 }
  17.                                                         }
  18.                                                         $apidecode =json_decode($getapi, true);
  19.                                                         foreach ($apidecode['items'] as $items) {
  20.                                                                 $title          = $items['snippet']['title'];
  21.                                                                 $desc           = $items['snippet']['description'];
  22.                                                                 $videoid        = $items['id']['videoId'];
  23.                                                                 $likes          = mt_rand(25000,40000);
  24.                                                                 $downloaded     = mt_rand($likes,40000);
  25.                                                                 $played         = mt_rand($downloaded,45000);
  26.                                                                 $viewed         = mt_rand($played,50000);
  27.                                                         echo '
  28.                                                                <div class="col-sm-12">
  29.                                                                        <div style="background-color: #F5F7FC;border: dotted 1px #D2D2CF;padding: 5px; overflow: auto;">
  30.                                                                                <div style="margin-left:5px">
  31.                                                                                        <a target="_blank" style="text-align:left;display:block;" href="http://'.$_SERVER['HTTP_HOST'].'/'.$dl_permalink.'/'.clean$
  32.                                                                                                 <!--<img height=90px width=120px align="left" src="http://img.youtube.com/vi/'.$videoid.'/default.jpg"></img>-->
  33.                                                                                                 '.$title.'
  34.                                                                                         </a>
  35.                                                                                 </div>
  36.                                                                                 <div style="margin-left:5px; text-align:left;">
  37.                                                                                         Bitrate : <b>256kbps</b> Likes : <b>'.$likes.'</b> Downloaded : <b>'.$downloaded.'</b> Played : <b>'.$played.'</b> Views :$
  38.                                                                                         <a href="http://'.$_SERVER['HTTP_HOST'].'/'.$dl_permalink.'/'.cleanPermalink($title).'?v='.$videoid.'" style="text-align:l$
  39.                                                                                </div>
  40.                                                                        </div>
  41.                                                                        <br>
  42.                                                                </div>
  43.                                                        ';
  44.                                                        }
  45.                                        //end youtube grabber
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement