git ssb

0+

Dominic / ssb-feed



Commit 2fcaca5f1bcf24281ce88c95e66a42e5aa553605

Merge pull request #8 from ssbc/readme-improvements

update readme for clarity
Paul Frazee committed on 1/18/2016, 8:31:16 PM
Parent: 69a6a76036c364846db285cd00c9434226a518c7
Parent: a75a9f03c984e9678af65100c3cf1e2417bf9422

Files changed

README.mdchanged
README.mdView
@@ -1,24 +1,36 @@
11 # ssb-feed
22
3-appendable to an ssb feed.
3+A publishing interface for scuttlebutt feeds.
44
5+By default, [Scuttlebot](https://ssbc.github.io/scuttlebot/) uses a "master" identity/feed, which `sbot.publish()` will append new messages to. If you want to manipulate additional feeds, you can load the keypair and then use this library to do so.
6+
57 ## Example
68
79 ``` js
810
9-var Feed = require('ssb-feed')
10-//can be a client instance, or a local scuttlebot instance.
11-var ssbc = require('ssb-client')()
11+var ssbFeed = require('ssb-feed')
12+var ssbClient = require('ssb-client')
1213 var ssbKeys = require('ssb-keys')
1314
1415 var alice = ssbKeys.generate()
15-var f = Feed(ssbc, alice)
16+ssbClient(function (err, sbot) {
17+ var feed = ssbFeed(sbot, alice)
1618
17-//post to alice's feed.
18-f.publish({type: 'post', text: 'hello world, I am alice.'}, function (err) {})
19+ // Post to alice's feed
20+ feed.publish({
21+ type: 'post',
22+ text: 'hello world, I am alice.'
23+ }, function (err) { ... })
24+
25+ // Also available:
26+ console.log(feed.id)
27+ console.log(feed.keys)
28+})
1929 ```
2030
31+This example uses `ssb-client`, but, if you're embedding `scuttlebot` or the `secure-scuttlebutt` library into your process, you can use them locally.
32+
2133 ## License
2234
2335 MIT
2436

Built with git-ssb-web