Facebook では、誰 (どのユーザー) が Facebook ページの投稿にコメントしたかを知る必要があります。javascript ファイルで facebook-batch-requests を使用して 2 つのリクエストを作成します。1 つ目はすべての投稿に対して、2 つ目は各投稿のリクエストが必要です。コメントのある投稿だけを選択できれば幸いです。
FB.api('/', 'POST', {
batch: [
{
// all posts from page from last year
'method': 'GET',
'name': 'posts_page_year',
'omit_response_on_success': false,
'relative_url': fbPageID + '/posts?since=2012-01-01&until=' + timeNow + '&limit=200000'
},
{
// all post-ids from last year
'method': 'GET',
"relative_url": "/{result=posts_page_year:$.data.*.id[?(@.comments.count!=0)]}"
}
]
}, function(response) {
callback(response);
}
);
私の問題は 2 番目のバッチ リクエストで、エラーが返されます (#803)。少し出してみました。
{
// all post-ids from last year
'method': 'GET',
"relative_url": "/{result=posts_page_year:$.data.0.id}"
}
最初のポストリクエストでオブジェクトを返します。すべてが良いです。しかし、最初の投稿だけでなく、すべての投稿でこれが必要です。
{
// all post-ids from last year
'method': 'GET',
"relative_url": "/{result=posts_page_year:$.data.*.id}"
}
エラー (#803) を返します。リクエストしたエイリアスの一部が存在せず、すべての ID のリストが返されます。
{
// all post-ids from last year
'method': 'GET',
"relative_url": "/{result=posts_page_year:$.data.*.id[?(@.comments.count!=0)]}"
}
次のエラーが返されます: (#803) リクエストしたエイリアスの一部が存在しません: {result=posts_page_year:$.data.*.id[
私はほとんどすべてを試してみましたが、問題を解決する方法がわからないため、あなたの助けが必要です. THX!