git ssb

2+

cel / scuttlebot.io



Tree: 86cfe7c6ec39c87ba43e41c3ed13c7902bf07fd8

Files: 86cfe7c6ec39c87ba43e41c3ed13c7902bf07fd8 / tmpl / docs / social / query-the-social-graph.html.js

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

Built with git-ssb-web