1
嘗試從YouTube上檢索用戶評論。下面在java中使用gwt-youtube-api-1.0.3從youtube中提取評論
String videoId = "3u1fu6f8Hto";
String str = "http://gdata.youtube.com/feeds/api/videos/" + videoId + "/comments";
YouTubeQuery youtubeQuery = new YouTubeQuery(new URL(str));
youtubeQuery.setMaxResults(50);
youtubeQuery.setStartIndex(1);
String videoEntryUrl = youtubeQuery.getUrl().toString();
VideoEntry videoEntry = service.getEntry(new URL(videoEntryUrl), VideoEntry.class);
String myUrl = youtubeQuery.getUrl().toString(); // only another name
CommentFeed commentFeed = service.getFeed(new URL(myUrl), CommentFeed.class); // Feed response
代碼代碼給出正顯示出不兼容的類型:URL不能轉換爲字符串
什麼是videoEntry –