问题描述
使用 Facebook 提供的 PHP 库的 2.1.2 版,针对 Graph API 设计我的第一个应用程序.试图最大限度地提高性能等开箱即用,并希望将几个调用一起批处理为一个调用,但在文档中找不到任何内容......我确定我一定遗漏了一些简单的东西,但我很难过.>
我想将这些调用(只是一个示例)转换为单个批处理调用:
$me = $facebook->api('/me', $params);$groups = $facebook->api('/me/groups', $params);Facebook 推荐使用 FQL 为此;http://developers.facebook.com/docs/guides/performance通过在(嵌套)查询中组合您的请求.
他们自己的例子:
$friends_locations = $facebook->api_client->fql_query('SELECT hometown_location from user where uid in ' .'(SELECT uid2 fromfriend where uid1=' . $user_id . ')');如果您的请求不相互依赖,您可以使用 fql.multiquery
Designing my first app against the Graph API, using version 2.1.2 of the Facebook supplied PHP library. Trying to maximize performance, etc out of the box and want to batch a few calls together into one call, but can't find anything in the documentation... I am sure I must be missing something simple, but am stumped.
I'd like to turn these calls (just an example) into a single batched call:
$me = $facebook->api('/me', $params);
$groups = $facebook->api('/me/groups', $params);
Facebook recommends using FQL for this; http://developers.facebook.com/docs/guides/performance by combining your requests in a (nested) query.
Their own example:
$friends_locations = $facebook->api_client->fql_query(
'SELECT hometown_location from user where uid in ' .
'(SELECT uid2 from friend where uid1=' . $user_id . ')');
If your requests aren't dependant on eachother you can use fql.multiquery
这篇关于使用 Facebook Graph API & 进行批量调用PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!



大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)