2012-10-25 42 views
1

ich想要編碼一個網站與一些YouTube頻道的信息。我得到了以下參數:Youtube頻道與PHP的參數(年齡,描述,上傳數量...)

訂閱:

<?php 
     $json = file_get_contents("http://gdata.youtube.com/feeds/api/users/*username*?alt=json"); 
     $data = json_decode($json, true); 
     echo '' . $data['entry']['yt$statistics']['subscriberCount']; 
     ?> 

香奈兒瀏覽次數:

<?php 
     $json = file_get_contents("http://gdata.youtube.com/feeds/api/users/*username*?alt=json"); 
     $data = json_decode($json, true); 
     echo '' . $data['entry']['yt$statistics']['viewCount']; 
     ?> 

總-瀏覽次數:

<?php 
     $json = file_get_contents("http://gdata.youtube.com/feeds/api/users/*username*?alt=json"); 
     $data = json_decode($json, true); 
     echo '' . $data['entry']['yt$statistics']['totalUploadViews']; 
     ?> 

但是我怎麼能得到上傳的視頻的計數。我只想顯示此用戶上傳的視頻數量。

我想顯示年齡,說明,摘錄,他加入YouTube的日期

有人能幫助我嗎?

回答

0

可以通過該頻道的上傳Feed的openSearch$totalResults->$t屬性獲取給定YouTube頻道中公共視頻的數量。這裏有一個例子GoogleDevelopers

http://gdata.youtube.com/feeds/api/users/googledevelopers/uploads?v=2&alt=json

"openSearch$totalResults": { 
    "$t": 1458 
} 

大部分的您正在尋找其他的信息,關於頻道創建者的個人信息,不再暴露在YouTube.com或通過API。

相關問題