Files: 6df421c40b28e10fe7138c1519f7c78ebb52f470 / tmpl / docs / social / query-the-social-graph.html.js
1197 bytesRaw
1 | var page = require('../../page.part') |
2 | var com = require('../../com.part') |
3 | |
4 | module.exports = () => page({ |
5 | section: 'docs', |
6 | tab: 'docs-social', |
7 | path :'/docs/social/query-the-social-graph.html', |
8 | content: ` |
9 | <h2>Get the current user ID</h2> |
10 | ${ com.code({ js: jsSnippet1, bash: bashSnippet1 }) } |
11 | |
12 | <h2>Fetch the social graph</h2> |
13 | ${ com.code({ js: jsSnippet2, bash: bashSnippet2 }) } |
14 | |
15 | <h2>List degrees-of-connection between users</h2> |
16 | ${ com.code({ js: jsSnippet3, bash: bashSnippet3 }) } |
17 | |
18 | <p class="next"><a href="/docs/social/update-your-profile.html">Update your profile</a></p> |
19 | <ul class="see-also"> |
20 | <li><a href="/modules/scuttlebot-friends.html">Scuttlebot.Friends API</a></li> |
21 | <li><a href="/modules/scuttlebot-friends.html">Follow users</a></li> |
22 | </ul> |
23 | ` |
24 | }) |
25 | |
26 | var jsSnippet1 = ` |
27 | sbot.whoami(function (err, res) { |
28 | // 'res.id' will have the pubkey id |
29 | }) |
30 | ` |
31 | |
32 | var bashSnippet1 = ` |
33 | sbot whoami |
34 | ` |
35 | |
36 | |
37 | var jsSnippet2 = ` |
38 | sbot.friends.all(function (err, graph) { |
39 | // ... |
40 | }) |
41 | ` |
42 | |
43 | var bashSnippet2 = ` |
44 | sbot friends.all |
45 | ` |
46 | |
47 | var jsSnippet3 = ` |
48 | sbot.friends.hops(userId, function (err, list) { |
49 | // ... |
50 | }) |
51 | ` |
52 | |
53 | var bashSnippet3 = ` |
54 | sbot friends.hops {userId} |
55 | ` |
Built with git-ssb-web