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",
グラフ 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 を呼び出すことができません。ちょっとここで立ち往生。