我正在使用 C# Facebook SDK 向 Facebook 查询 /home 提要,并且提要包含照片。提要中的“图片”链接是低分辨率的,所以我必须从提要中查找照片的“object_id”才能获得高分辨率版本。
这就是我想要完成的
- 获取 /home 饲料
从 /home 响应中的所有“object_id”中,获取“object_id”
Common._fb.BatchTaskAsync(new[]{ new FacebookBatchParameter(HttpMethod.Get, "/me", new Dictionary<string, object> { { "limit", 25 }, {"access_token", Common._fb.AccessToken} }), new FacebookBatchParameter("/me/home", new { limit = 25 }) { Data = new { name = "home-feed", omit_response_on_success = false } }, new FacebookBatchParameter(HttpMethod.Get, "/{result=home-feed:$.data.*.object_id}", new { limit = 25 }), new FacebookBatchParameter("/me/error")});
我遇到的问题是 object_id 调用失败,但出现以下异常:
{"error":{"message":"(#803) Some of the aliases you requested do not exist: 432468803491390,10151350857109036,388654974561669,197117360426100,443878372332478,445366662199631,457265447662406,475836539118390,474145425981640,363838440380681","type": "OAuthException","code":803}} 对象 {Facebook.JsonObject}
这是第一次调用的数据的样子:
"type": "photo", "status_type": "shared_story", "object_id": "379861798777414",
在graph API中,object_id可以这样直接查询:/379861798777414
id":
"379861798777414",
"from":
{
"category":
"Automobiles and parts",
"name":
"Legendary Speed Inc.",
"id":
"142234555873474"
},
"name":
"FOR SALE:\nClick the link for Price and Info\nhttp://www.legendaryfind.com/cars/pin/38000/",
"picture":
"https://photos-b.xx.fbcdn.net/hphotos-ash4/603137_379861798777414_485849814_s.jpg",
"source":
"https://sphotos-b.xx.fbcdn.net/hphotos-ash4/603137_379861798777414_485849814_n.jpg",
"height":
265,
"width":
400,
"images":
[
{
"height": 1356,
"width": 2048,
"source": "https://sphotos-b.xx.fbcdn.net/hphotos-ash4/s2048x2048/603137_379861798777414_485849814_n.jpg"
}
我不知道为什么,但我无法像这样从批处理参数中调用 object_id。有点卡在这里。