git ssb

0+

dangerousbeans / ScuttlebotCookbook



Tree: d08c3c7bdce7a934fac2440f8fd5f1bd0269f77c

Files: d08c3c7bdce7a934fac2440f8fd5f1bd0269f77c / channels.js

786 bytesRaw
1var pull = require('pull-stream')
2var repl = require('repl')
3var ssbClient = require('ssb-client')
4ssbClient(function (err, sbot) {
5 // open the repl session
6 var replServer = repl.start({})
7 replServer.context.sbot = sbot
8
9 // stream all messages for all keypairs.
10 pull(
11 sbot.createFeedStream({ limit: 10 }),
12 pull.collect(function (err, ary) {
13 replServer.context.allMessages = ary
14 })
15 )
16
17 // Get All channels
18 var filter = {
19 dest: `#${channel}`,
20 value: {
21 timestamp: typeof lt === 'number' ? {$lt: lt, $gt: 0} : {$gt: 0}
22 }
23 }
24
25
26 pull(
27 sbot.createFeedStream({ limit: 10 }),
28 pull.collect(function (err, ary) {
29 replServer.context.allMessages = ary
30 })
31 )
32
33
34
35 // TODO: How do you get this to return and not hang forever?
36})
37

Built with git-ssb-web