LoginSignup
0
0

More than 5 years have passed since last update.

FacebookのGraph APIでユーザーの母国語名取得

Posted at

今まで「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"
    }
  }
*/
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0