git ssb

2+

mixmix / ticktack



Tree: 67583b0e9605f9e2c2a95ff125a23e8a1cca8953

Files: 67583b0e9605f9e2c2a95ff125a23e8a1cca8953 / blog / sync / isBlog.js

530 bytesRaw
1const nest = require('depnest')
2const get = require('lodash/get')
3const isBlog = require('scuttle-blog/isBlog')
4
5exports.gives = nest({
6 'blog.sync.isBlog': true,
7})
8
9const MIN_LENGTH_FOR_BLOG_POST = 800
10
11exports.create = function (api) {
12 return nest({
13 'blog.sync.isBlog': isBloggy
14 })
15
16 function isBloggy (msg) {
17 if (isBlog(msg)) return true
18
19 const type = msg.value.content.type
20 if (type === 'post' && get(msg, 'value.content.text', '').length > MIN_LENGTH_FOR_BLOG_POST) return true
21 return false
22 }
23}
24
25

Built with git-ssb-web