【问题标题】:getting comments from a youtube video - GData objective-c从 youtube 视频中获取评论 - GData objective-c
【发布时间】:2012-03-08 12:30:21
【问题描述】:

我正在开发一个需要使用 YouTube 的 iPhone 应用程序。我想知道如何从视频中获取 cmets?我环顾四周,但没有运气......对不起,如果这个问题有点开放式结束

【问题讨论】:

    标签: iphone objective-c ios youtube gdata


    【解决方案1】:

    您应该检查YouTube API。在此 API 中,Video comments feed 可用。

    【讨论】:

      【解决方案2】:

      有一个Objective-C library for Google Data APIs

      其中包含一个sample application,说明如何使用 YouTube 数据 API。

      【讨论】:

        【解决方案3】:
        GDataEntryYouTubeVideo * video = {your video entry here};
        
        GDataServiceGoogleYouTube * youtubeService = [[GDataServiceGoogleYouTube alloc] init];
        
        youtubeService.userAgent = @"App Name";
        youtubeService.youTubeDeveloperKey = @"your developer key";
        
        GDataQueryYouTube * query = [[GDataQueryYouTube alloc] init];
        
        query.startIndex = 1;
        query.maxResults = 50;
        query.feedURL = video.comment.feedLink.URL;
        
        [youtubeService fetchFeedWithQuery:query
                              completionHandler:^(GDataServiceTicket *ticket, GDataFeedBase *feed, NSError *error)
        {
            if(error)
            {
                return;
            }
        
            GDataFeedYouTubeComment * commentFeed = (GDataFeedYouTubeComment*)feed;
        
            NSArray * comments = feed.entries;
        }];
        

        【讨论】:

          猜你喜欢
          • 2012-12-17
          • 2023-03-09
          • 2017-08-13
          • 1970-01-01
          • 2017-07-12
          • 2017-12-11
          • 1970-01-01
          • 2012-11-07
          • 2016-11-14
          相关资源
          最近更新 更多