1.0.0 • Published 5 years ago

rdi-yandex-turbo v1.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

rdi-yandex-turbo

Installation

npm i rdi-yandex-turbo

Usage

const YandexTurbo = require('rdi-yandex-turbo');
const service = new YandexTurbo({
  key: 'The authorization token',
  userId: 'User id',
  hostID: 'Host:id:80',
  mode: 'PRODUCTION', // or 'DEBUG'
  logger: console
});

First run

Need to pass the verification procedure.

const ok = await service.verify(
  'http://my.host',
  '/path/to/public/dir/for/create/verify/file'
);

if (ok) {
  // save this to config
  this.userID
  this.hostID
}

Send RSS

const fsReadStream = fs.createReadStream('/path/to/turbo-rss.xml');

await service.turbo.sendRSS(fsReadStream, {gzip: false});