diff --git a/backend/view.js b/backend/view.js index be4b1a2..6dcbd93 100644 --- a/backend/view.js +++ b/backend/view.js @@ -1,20 +1,21 @@ const l = process.argv[2]; +const pull = require('pull-stream'); const ssbClient = require('ssb-client'); const ssbKeys = require('ssb-keys'); const ssbFeed = require('ssb-feed'); -const pull = require('pull-stream'); -const keyz = ssbKeys.load('/var/www/backend/keys/' + l , function(err, k) { - ssbClient(keyz, - function (err, sbot) { - pull( - sbot.createHistoryStream({ id: k.id, live: false } ), - pull.filter(msg => typeof msg.value.content === 'object' && !msg.value.content.root), - pull.collect((err, msgs) => { - console.log(JSON.stringify(msgs)); - sbot.close(); - }) - ) - }) -}) \ No newline at end of file +const keyz = ssbKeys.load('/var/www/backend/keys/' + l, function(err, k) { + ssbClient(keyz, function(err, sbot) { + pull( + sbot.createHistoryStream({id: k.id}), + pull.filter( + msg => typeof msg.value.content === 'object' && !msg.value.content.root + ), + pull.collect((err, msgs) => { + console.log(JSON.stringify(msgs)); + sbot.close(); + }) + ); + }); +}); \ No newline at end of file