* @throws IOException Error sending request or reading the feed.
* @throws ServiceException If the service is unable to handle the request.
*/
private static void printActivityFeed(YouTubeService service, String feedUrl)
throws IOException, ServiceException {
UserEventFeed activityFeed = service.getFeed(new URL(feedUrl),
UserEventFeed.class);
String title = activityFeed.getTitle().getPlainText();
printUnderlined(title);
if (activityFeed.getEntries().size() == 0) {
System.out.println("This feed contains no entries.");
return;
}
for (UserEventEntry entry : activityFeed.getEntries()) {
String user = entry.getAuthors().get(0).getName();
if(entry.getUserEventType() == UserEventEntry.Type.VIDEO_UPLOADED) {
System.out.println(user + " uploaded a video " + entry.getVideoId());
}
else if(entry.getUserEventType() == UserEventEntry.Type.VIDEO_RATED) {