0)
{
declare _isappadded integer;
declare exit handler for sqlstate '*' {
--this will clear cookies for your application and redirect them to a login prompt
_facebook.set_user(null, null, null);
_facebook.redirect(appcallbackurl);
};
{
_isappadded:=coalesce(_facebook.api_client.users_isAppAdded(),0);
if(_isappadded=0)
_facebook.redirect(_facebook.get_add_url(null));
};
http('Hello, user:'||cast(_user as varchar)||'
');
declare _res any;
_res:=_facebook.api_client.friends_get(); --just this function returns array as result ... all the other functions return xml entity
if(_res is not null and length(_res)>0)
{
declare i integer;
i:=0;
http('Your friends ids are:
');
while(i');
i:=i+1;
}
}
-- dbg_obj_print(_facebook.api_client.friends_areFriends(_user,'550323720'));
-- dbg_obj_print(_facebook.api_client.events_get(_user));
-- dbg_obj_print(_facebook.api_client.events_getMembers(3932288121));
--dbg_obj_print(_facebook.api_client.friends_getAppUsers());
--dbg_obj_print(_facebook.api_client.groups_get(_user,null));
--dbg_obj_print(_facebook.api_client.groups_get(null,'5675175173'));
--dbg_obj_print(_facebook.api_client.groups_getMembers(5675175173));
--dbg_obj_print(_facebook.api_client.notifications_get());
--dbg_obj_print(_facebook.api_client.notifications_send(_user,'Please check out this awesome app!',null));
--dbg_obj_print(_facebook.api_client.photos_getAlbums(_user, null));
--dbg_obj_print(_facebook.api_client.photos_get(null, '2848412780174777707',null));
--dbg_obj_print(_facebook.api_client.photos_getTags('2848412780174923463'));
--dbg_obj_print(_facebook.api_client.users_getInfo('2848412780174923463'));
--dbg_obj_print(_facebook.api_client.users_getInfo(cast(_user as varchar)||',550323720,605980750','name,first_name,last_name'));
--dbg_obj_print(_facebook.api_client.fql_query('SELECT uid,name,first_name,last_name FROM user WHERE uid = '||cast(_user as varchar)));
}
?>