Search code examples
facebookfacebook-fqlfacebook-friends

How to get facebook friends work_history and company id?


Hi I am using following FQL to fetch friends list from facebook and their details

select uid, name, work_history, education_history, current_location from user where uid IN (select uid2 from friend where uid1=FACEBOOK_USER);

and I get the following result array which fine and correct.

Now my question is it any how possible to get the company id in which friend works. A unique identifier of the company so that I can fetch company specific details using e.g. http://graph.facebook.com/cocacola (an example of getting details of cocacola company/fan-page) ???

Such as friend working in GO-AdventureSports should also have unique identifier in the array.

Array ( [0] => Array ( [uid] => 12312312312 [name] => Raj Singh [work_history] => Array ( [0] => Array ( [company_name] => Intersil )

            )

        [education_history] => Array
            (
            )

        [current_location] => Array
            (
                [city] => Santa Clara
                [state] => California
                [country] => United States
                [zip] => 
                [id] => 1231231231
                [name] => Santa Clara, California
            )

    )

[1] => Array
    (
        [uid] => 123123123
        [name] => Rana Sidhu
        [work_history] => Array
            (
                [0] => Array
                    (
                        [location] => Array
                            (
                                [city] => 
                                [state] => 
                            )

                        [company_name] => GO-AdventureSports
                        [description] => 
                        [start_date] => 
                        [end_date] => 
                    )

            )

        [education_history] => Array
            (
            )

        [current_location] => 
    )

Any ideas are highly appreciated ...


Solution

  • In the above sql query just add work and it will return company names with their ids. Now if one want work_history can be ignored.

    final query

    select uid, name, work_history, work, education_history, current_location from user where uid IN (select uid2 from friend where uid1=FACEBOOK_USER);

    Hope it help some one.

    -deepak