-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
143efc8
commit e62172c
Showing
1 changed file
with
15 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
}) | ||
) | ||
}) | ||
}) | ||
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(); | ||
}) | ||
); | ||
}); | ||
}); |