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