var page = require('../../page.part') var com = require('../../com.part') module.exports = () => page({ section: 'docs', tab: 'docs-social', path :'/docs/social/query-the-social-graph.html', content: `

Get the current user ID

${ com.code({ js: jsSnippet1, bash: bashSnippet1 }) }

Fetch the social graph

${ com.code({ js: jsSnippet2, bash: bashSnippet2 }) }

List degrees-of-connection between users

${ com.code({ js: jsSnippet3, bash: bashSnippet3 }) }

Update your profile

` }) var jsSnippet1 = ` sbot.whoami(function (err, res) { // 'res.id' will have the pubkey id }) ` var bashSnippet1 = ` sbot whoami ` var jsSnippet2 = ` sbot.friends.all(function (err, graph) { // ... }) ` var bashSnippet2 = ` sbot friends.all ` var jsSnippet3 = ` sbot.friends.hops(userId, function (err, list) { // ... }) ` var bashSnippet3 = ` sbot friends.hops {userId} `