steem.api.getDiscussionsByBlog({"tag": "morning", "limit": 20}, function(err, result) {
console.log(err, result);
});
이렇게 하면 morning이 쓴 글 최신 글 20개가 뽑아집니다.
{id: 10201359, author: "morning", permlink: "11-segwit2x", category: "kr", parent_author: "", …}
{id: 9915766, author: "morning", permlink: "5dtywx", category: "kr", parent_author: "", …}
{id: 9670983, author: "roychoi", permlink: "korea-steem-park", category: "koreasteempark", parent_author: "", …}
... 20개 ...
{id: 5886755, author: "leesol", permlink: "0", category: "art", parent_author: "", …}
이중 제일 마지막 것의 author 와 permlink 값을 가져다가
steem.api.getDiscussionsByBlog({"tag": "morning", "limit": 20, "start_author": "leesol", "start_permlink": "0"}, function(err, result) {
console.log(err, result);
});
start_author 와 start_permlink 라고 하는 파라미터에 넣어주면 그다음 20개가 나옵니다.
재귀호출을 하다가 결과값이 20개 미만으로 나오면 목록의 마지막인 것이므로 재귀호출을 끝내면 됩니다.