1.0.0 • Published 5 years ago
rdi-yandex-turbo v1.0.0
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});
1.0.0
5 years ago