今まで「FQL」を使う方法しか知らなかったけど、Graph APIでも母国語名の取得が出来たのか…
という事で以下備忘録的に。
<?php
// 略
// fbの友達リスト取得
$graph_url = "https://graph.facebook.com/me/friends/?locale=ja_JP&access_token=" . $access_token;
$friendlist = json_decode(file_get_contents($graph_url));
/* var_dump($friendlist);
object(stdClass)#79 (2) {
["data"]=>
array(5) {
[0]=>
object(stdClass)#80 (2) {
["name"]=>
string(19) "山田 太郎"
["id"]=>
string(10) "xxxxxxxxxxxxxxx"
}
[1]=>
object(stdClass)#81 (2) {
["name"]=>
string(10) "山田 花小"
["id"]=>
string(15) "xxxxxxxxxxxxxxx"
}
}
*/