English 中文(简体)
我如何把100多个地位称作Facebook的APIC?
原标题:How do I call more than 100 statuses with Facebook API?

我建造了一个“Face”应用程序,我希望它能够从过去一年来阅读所有用户状况。 当我发出APICA/6号呼吁时,我只能收回头100个地位,不管我设定了限制。

Here s the URL I m using to make the call: https://graph.facebook.com/me/statuses?limit=100&access_token=...

当我确定限额较低时,该限额显示地位较低(证明限制理由有效)。 当我确定限额更高时,它只给我头100人。 我自此使用时,这只给我100个。

当我使用下游时,我看不到头100个身份。

I know it s possible to get much more than that because of applications such as My Year In Status

最佳回答
问题回答

它确实工作。 页: 1 查询参数。 <条码>参数为批量。 <代码>offset参数规定了用户全时状况收集中的位置。 如果不具体说明<代码>offset para amount,Facebook将其拖欠为零,这就是为什么你看到同样的数据集。

For the 1st batch of 100 statuses, set limit to 100 and offset to 0.
For the 2nd batch of 100 statuses, set limit to 100 and offset to 100.
For the 3rd batch of 100 statuses, set limit to 100 and offset to 200.
For the 4th batch of 100 statuses, set limit to 100 and offset to 300.
And so on...

Keep iterating until you get an empty dataset:

{
   "data": []
}

<>PagingSince, Until参数对我也不适用。

But I found out, that I m able get more then 100 statuses using Offset parameter. Here is my code using Facebook C# SDK:

var fb = new FacebookClient(accessToken);

string connection = "statuses";
string urltemplate = "https://graph.facebook.com/me/{0}?limit={1}&offset={2}";

int limit = 25;     //items on one page (Max is value 100)
int offset = 0;

var statuses = (IDictionary<string, object>)fb.Get(string.Format(urltemplate, connection, limit, offset));

while (statuses != null && statuses.ContainsKey("data") && ((Facebook.JsonArray)statuses["data"]).Count > 0)
{
    var dataItems = (Facebook.JsonArray)statuses["data"];

    foreach (Facebook.JsonObject item in dataItems)
    {
        //TODO: process item data
        System.Diagnostics.Debug.WriteLine(item["message"]);
    }

    offset += limit;
    statuses = (IDictionary<string, object>)fb.Get(string.Format(urltemplate, connection, limit, offset));
}

Facebook关闭了以前的ug,没有进行真正的测试,看看看它做的是没有工作。 我在这里做了新的轮.:https://developersfacebook.com/bugs/242235199184053





相关问题
Facebook Connect login dialog not working

I am using Facebook Connect for iPhone and following the official instructions. I use the following code to display the login dialog: FBLoginDialog* dialog = [[[FBLoginDialog alloc] initWithSession:...

Facebook App Profile Tab is Empty ... No Content Displayed?

I can view my application via the http://apps.facebook.com/myapplication/ link and the content shows up correctly. I also added the application as a tab to a facebook page. However, when viewing the ...

Facebook Platform error: "Object cannot be liked"

I m working on a Facebook Application that generates wall posts. In testing these posts, I ve discovered that the Facebook Platform action of "liking" a post is failing. The specific error message ...

how to call showPermissionsDialog() in php (facebook api)?

I was reading over the documentation yet I could not figure out how to call Facebook.showPermissionsDialog() in php include_once ./facebook-platform/php/facebook.php ; $facebook = new Facebook(my ...

Facebook connect

If I plug in the facebook connect into my website, How can I prevent double signups? Lets say I have a user that s already signed up to my site but he clicked the connect with facebook, is there a ...

热门标签