RestFB를 사용하여 페이스 북의 페이지에서 게시물을 얻습니다. 문제는 단지 지난 달의 게시물을 예로 들자면 페이지의 최신 게시물 만 원한다는 것입니다. 내 코드를 통해 나는 모든 역사를 얻었으며 많은 시간이 걸린다. 어떻게하면됩니까? "타임 스탬프"매개 변수에 대해 읽지 않았습니다. 나는 좋은 결과없이 한계 매개 변수로 시도했다.RestFB를 사용하는 Facebook의 최신 게시물 만 가져 오기
내 코드는 다음과 같습니다
public static JSONArray GetPostsFromPage(String idpage) {
String texto, idpost;
Date timestamp;
JSONArray array = new JSONArray();
JSONObject objeto;
Connection<Post> postFeed = fbClient.fetchConnection(idpage + "/feed", Post.class, Parameter.with("limit", 50));
for (List<Post> postPage : postFeed) {
for (Post aPost : postPage) {
objeto = new JSONObject();
idpost = aPost.getId();
texto = aPost.getMessage();
timestamp = aPost.getCreatedTime();
objeto.put("id", idpost);
objeto.put("texto", texto);
objeto.put("timestamp", timestamp);
array.put(objeto);
}
}
return array;
}
어떤 생각을 환영합니다. 고맙습니다.