1.0.13 • Published 7 years ago

tfk-seneca-collect-content-wp v1.0.13

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Build Status js-standard-style

tfk-seneca-collect-content-wp

Greenkeeper badge Collect content from wp sites with rest-api plug-in enabled.

Messages handled

cmd: collect-info, type: user

Collects content for a user and/or a user's roles

seneca.act({cmd: 'collect-info', type:'user', user:user, roles:[roles]}, (error, data) => {})
$ curl -d '{"cmd":"collect-info", "type": "user", "user":"gasg", "roles": ["alle"]}' -v http://localhost:8000/act

Messages emitted

role: info, info: content-collected

Contains collected info for user/role wrapped in the data property

{
    system: 'systemname',
    type: 'news',
    user: user,
    data: [] //collected info
  }

Example

'use strict'

const seneca = require('seneca')()
const content = require('tfk-seneca-collect-content-wp')
const options = {
  type: 'news',
  channelId: 'news',
  feedHostUrl: 'https://info.portalen.no/wp-json/wp/v2/posts',
  verbose: false // Turns logging on/off
}

seneca.add('role: info, info: content-collected', (args, callback) => {
  console.log(args.data)
  callback()
})

seneca.use(content, options)

seneca.act('cmd: collect-info, type: user', {user: 'gasg', roles: ['alle', 'administrasjonen']})

License

MIT

1.0.13

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.4

7 years ago

1.0.0

7 years ago