Created
July 6, 2017 10:33
-
-
Save anonymous/1c2517d1e22abc41849c1f6cffd859d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var steem = require('steem'); | |
var FETCH_COUNT = 50; | |
var query = { | |
tag: 'kr-dev', | |
limit: FETCH_COUNT + 1, | |
}; | |
(function run() { | |
steem.api.getDiscussionsByCreated(query, function(err, result) { | |
if (err) { | |
console.log(err); | |
} | |
console.log('---- ', result.length, query.start_author, query.start_permlink); | |
// console.log(result); | |
if ( typeof result === "undefined") { | |
console.log("---end"); | |
return; | |
}; | |
for (var i = 1; i < FETCH_COUNT + 1; i++) { | |
var e = result[i]; | |
console.log(e.created, e.permlink, ' - ', e.title); | |
} | |
var last_permlink = result[FETCH_COUNT].permlink; | |
var last_author = result[FETCH_COUNT].author; | |
query.start_author = last_author; | |
query.start_permlink = last_permlink; | |
run(); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment