取得できるのはスニペット変数だけです...統計に関連するものは何もありません。特定の各ビデオの好きなもの、嫌いなもの、および期間を取得しようとしています。
+(void) getListOfVideosFromSearchTerm: (NSString *) term usingCallback: (getListOfVideosCallback) callback{
if (youTubeService.authorizer == nil) callback(nil);
__block NSMutableArray *videosArray = [NSMutableArray array];
GTLQueryYouTube *query = [GTLQueryYouTube queryForSearchListWithPart:@"id,snippet"];
query.maxResults = 10;
query.q = term;
query.videoEmbeddable = @"true";
query.type = @"video";
GTLServiceTicket *ticket = [youTubeService executeQuery:query
completionHandler:^(GTLServiceTicket *ticket, id object, NSError *error) {
// This callback block is run when the fetch completes
if (error == nil) {
GTLYouTubeSearchListResponse *products = object;
// iteration of items and subscript access to items.
for (GTLYouTubeSearchResult *item in products) {
ILVVideo *newVideo = [[ILVVideo alloc] init];
newVideo.title = item.snippet.title;
newVideo.description = item.snippet.descriptionProperty;
newVideo.thumbnail.urlForHighResolution = item.snippet.thumbnails.high.url;
newVideo.thumbnail.highResolutionSize = CGSizeMake([item.snippet.thumbnails.high.width floatValue], [item.snippet.thumbnails.high.height floatValue]);
newVideo.thumbnail.urlForMediumResolution = item.snippet.thumbnails.medium.url;
newVideo.thumbnail.mediumResolutionSize = CGSizeMake([item.snippet.thumbnails.medium.width floatValue], [item.snippet.thumbnails.medium.height floatValue]);
newVideo.thumbnail.urlForStandardResolutionImage = item.snippet.thumbnails.standard.url;
newVideo.thumbnail.standardResolutionSize = CGSizeMake([item.snippet.thumbnails.standard.width floatValue], [item.snippet.thumbnails.standard.height floatValue]);
[videosArray addObject:newVideo];
NSLog(@"%@",item.snippet.title);
}
callback(videosArray);
}else{
NSLog(@"Error: %@", error.description);
}
}];
}