#!/usr/bin/env php set_user($uid, $session_key); $facebook->set_session_secret($secret); $calls = array( 'fql_query("select sex, birthday from user where uid = $uid")', #'friends_get()', #'friends_getAppUsers()', #'profile_getFBML("")', #'users_getInfo(array($uid), array("about_me", "affiliations"))', 'users_getLoggedInUser()' ); foreach ($calls as $call) { $facebook->api_client->json = 0; for ($json = &$facebook->api_client->json; $json != 2; ++$json) { try { $value = eval("return \$facebook->api_client->$call;"); } catch (FacebookRestClientException $exception) { $value = $exception; } if ($json) echo 'JSON '; else echo 'XML '; print_r($value); if (is_scalar($value)) echo "\n"; } }