npm

Need private packages and team management tools?Check out npm Orgs. »

ssb-backlinks

0.7.3 • Public • Published

ssb-backlinks

scuttlebot plugin for indexing all link mentions of messages (including private for the current identity).

Walks all values of a message searching for ssb-ref recognized keys. Provides an ssb-query style interface.

Example usage

const pull = require('pull-stream')
function createBacklinkStream (id) {
  var filterQuery = {
    $filter: {
      dest: id
    }
  }
 
  return sbot.backlinks.read({
    query: [filterQuery],
    index: 'DTA', // use asserted timestamps
    live: true
  })
}
 
const msgKey = '%+zYA9WF9cY+HqGLzqS1H7FdUdK45tUmTqiZ85p+RNOQ=.sha256'
var relatedMessages = []
 
pull(
  createBacklinkStream(msgKey),
  pull.filter(msg => !msg.sync),
    // note the 'live' style streams emit { sync: true } when they're up to date!
  pull.drain(msg => {
    relatedMessages.push(msg)
  })
)

Versions

Please note that 0.7.0 requires scuttlebot 11.3

License

MIT

Keywords

none

install

npm i ssb-backlinks

Downloadsweekly downloads

151

version

0.7.3

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
Report a vulnerability