2014-02-13 55 views
0

任何YouTube視頻的評論,我使用如何獲得/提交使用 「谷歌API-的ObjectiveC客戶」

[谷歌API-的ObjectiveC客戶端(https://code.google.com/p/google-api-objectivec-client/

我想任何YouTube視頻的評論。如果有人嘗試過,請指導我如何做到這一點。

這是我的代碼來獲得最熱門影片

- (void)getMostPopularOnCompletion:(void (^)(void))completion withCurrentUserChannel:(GTLYouTubeChannel*)currentUserChannel{ 

    mostPopularFlag = YES; 
    hud = [MBProgressHUD showHUDAddedTo:self.revealController.navigationController.view animated:YES]; 
    hud.mode = MBProgressHUDModeIndeterminate; 
    hud.labelText = @"Loading"; 

    GTLQueryYouTube *videoQuery = [GTLQueryYouTube queryForPlaylistItemsListWithPart:@"id, snippet, contentDetails, statistics" Chart:@"mostPopular"]; 
    videoQuery.maxResults = 50; 

    // if(nextPageToken){ 
    //  videoQuery.pageToken = nextPageToken; 
    // } 

    [_menu.youtubeService executeQuery:videoQuery 
        completionHandler:^(GTLServiceTicket *ticket, GTLYouTubeVideoListResponse *object, NSError *error) { 
         _mostPopularVideos = [object.items mutableCopy]; 
         _mostPopularVideosOriginal = [object.items mutableCopy]; 
         [_filterSegmentO setSelectedSegmentIndex:0]; 
         [_mainTableView setAccessibilityHint:@"0"]; 
         [hud hide:YES]; 
         hud=nil; 
         [_mainTableView setTag:0]; 
         [_mainTableView reloadData]; 
         for (int i = 0; i < object.items.count; i++) { 
          GTLYouTubeVideo *video = object.items[i]; 
          [self getChannelImage:video.snippet.channelId]; 
         } 

         if (completion){ 
          completion(); 
         } 
        }]; 
} 

回答

1

評論讀/寫上不可用數據API V3,但(這是objc-客戶端基於的)。但你可以read through the old API

相關問題