Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing users languages using Graph API?

How do you access a user's languages using the Facebook GRAPH API? I don't see it anywhere in the permissions and I can't find it any other way. If a user lists that they speak Spanish or French, how can I find this?

like image 637
Matthieu McLaren Avatar asked Nov 16 '11 01:11

Matthieu McLaren


2 Answers

You can get the languages from https://graph.facebook.com/me .

If you are looking for user locale as @chacham15 mentions then its from locale variable . See https://graph.facebook.com/harikt .

You can try http://developers.facebook.com/tools/explorer?method=GET&path=me and see it in action.

Update :

The permission user_likes is need to access the languages array .

    [languages] => Array
    (
        [0] => Array
            (
                [id] => 105692839465644
                [name] => Malayalam
            )

        [1] => Array
            (
                [id] => 106059522759137
                [name] => English
            )

    )

Hope this solves your issue.

like image 62
Hari K T Avatar answered Sep 28 '22 09:09

Hari K T


What I do is to check the user locale and I assume that he speaks that language, for example:

$locale_f=$parsedJson->locale; 
$lang1=explode("_",$locale_f);
if ($lang1[0]=="es") $lang1="espagnol";
if ($lang1[0]=="en") $lang1="anglais";
if ($lang1[0]=="it") $lang1="italien";
if ($lang1[0]=="pt") $lang1="portugais";
if ($lang1[0]=="fr") $lang1="francais";
like image 34
Gaston Avatar answered Sep 28 '22 09:09

Gaston