如何使用c#从google plus获取所有帖子/活动

时间:2014-08-12 09:43:22

标签: c# google-plus

我正在尝试从谷歌+墙上获取所有帖子,但我只能获得20个帖子。请帮助我。我的代码是 -

 PlusService plus = new PlusService(
            new Google.Apis.Services.BaseClientService.Initializer()
            {
                ApiKey = "AIzaSyDWG1Ho6PVC6FlPXv5rommyzCAf0ziHkTo"
            });

            ActivitiesResource ar = new ActivitiesResource(plus);

            ActivitiesResource.ListRequest list = ar.List(id, new ActivitiesResource.ListRequest.CollectionEnum());


            ActivityFeed feed = list.Execute();

1 个答案:

答案 0 :(得分:0)

使用MaxResults类的ListRequest属性。

PlusService plus = new PlusService(
            new Google.Apis.Services.BaseClientService.Initializer()
            {
                ApiKey = "AIzaSyDWG1Ho6PVC6FlPXv5rommyzCAf0ziHkTo"
            });

            ActivitiesResource ar = new ActivitiesResource(plus);

            ActivitiesResource.ListRequest list = ar.List(id, new ActivitiesResource.ListRequest.CollectionEnum());

            list.MaxResults = 100; // Or whatever number you want

            ActivityFeed feed = list.Execute();

请注意,最大数量为100。

Google.Apis.Orkut.v2.ActivitiesResource.ListRequest Class Reference