使用facebook api和分页获取所有Facebook帖子

use*_*007 3 facebook facebook-graph-api

我打算收到所有过去的帖子.我创建了一个Facebook应用程序.执行此代码时,我已使用正确的appid和密码正确登录.

function loadPage() {   // calls the first batch of records
   FB.api("/me/feed",{},function(response) { procBatch(response) } );
   }

function procBatch(dat) { // handle this batch, request the next batch
   for ( i = 0; i < dat.data.length; i++ ) {
      procRow(dat.data[i]);  // process this row
      }
   if ( typeof(dat.paging) != 'undefined' ) {
      FB.api(dat.paging.next, {}, function(response){ procBatch(dat); } );
      } else {
      alert("No more records expected");
      }
   }
Run Code Online (Sandbox Code Playgroud)

不幸的是,这只能让我回到大约六个月.

是否有可能进一步回归?

提前致谢.

Rah*_*ora 5

是的,这是可能的.

这可以通过增加每页数量对象的限制来完成.我没有尝试检索所有帖子,但我很确定你可以轻松检索甚至几年前的帖子.

您可以致电/me/feed?limit=numberOfObjectsPerPage而不是仅仅/me/feed增加此限制.

您可以在此处找到更多相关信息.请查看链接上的基于时间的分页.这将解释如何管理订阅源的输出.