git ssb

2+

cel / scuttlebot.io



Tree: 3ed513c33a63c4dec6c04e26770a621df61cc360

Files: 3ed513c33a63c4dec6c04e26770a621df61cc360 / tmpl / docs / social / query-the-social-graph.html.js

1232 bytesRaw
1var page = require('../../page.part')
2var com = require('../../com.part')
3
4module.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
27var jsSnippet1 = `
28sbot.whoami(function (err, res) {
29 // 'res.id' will have the pubkey id
30})
31`
32
33var bashSnippet1 = `
34sbot whoami
35`
36
37
38var jsSnippet2 = `
39sbot.friends.all(function (err, graph) {
40 // ...
41})
42`
43
44var bashSnippet2 = `
45sbot friends.all
46`
47
48var jsSnippet3 = `
49sbot.friends.hops(userId, function (err, list) {
50 // ...
51})
52`
53
54var bashSnippet3 = `
55sbot friends.hops {userId}
56`

Built with git-ssb-web