Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $canale = $_GET['channel'];
- $funzione = $_GET['funzione'];
- $ciao = json_decode(file_get_contents('http://gdata.youtube.com/feeds/api/users/' . $canale . '?v=2&alt=json'));
- function getYouTubeVideoViews($channel, $stat = 'totalUploadViews')
- {
- return json_decode(file_get_contents('http://gdata.youtube.com/feeds/api/users/' . $channel . '?v=2&alt=json'))->entry->{'yt$statistics'}->$stat;
- }
- switch ($funzione){
- case "iscritti":
- echo getYouTubeVideoViews($canale, 'subscriberCount');
- break;
- case "views":
- echo getYouTubeVideoViews($canale, 'viewCount');
- break;
- case "video":
- echo getYouTubeVideoViews($canale, 'videoWatchCount');
- break;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment