2024-10-02 16:53:07 +03:00
|
|
|
import Database from 'better-sqlite3';
|
|
|
|
import Jackd from 'jackd';
|
2019-04-29 23:36:04 +03:00
|
|
|
|
2024-10-02 16:53:07 +03:00
|
|
|
const beanstalkd = new Jackd();
|
|
|
|
const db = new Database('bot-node.db');
|
2019-04-29 23:36:04 +03:00
|
|
|
|
|
|
|
async function foo() {
|
|
|
|
|
|
|
|
// get all feeds from DB
|
|
|
|
let feeds = db.prepare('select feed from feeds').all();
|
|
|
|
|
2021-10-12 19:12:03 +03:00
|
|
|
// console.log('!!!',feeds.length);
|
2019-04-29 23:36:04 +03:00
|
|
|
|
|
|
|
let count = 0;
|
|
|
|
|
|
|
|
await beanstalkd.connect()
|
|
|
|
|
2024-10-02 16:53:07 +03:00
|
|
|
for (let feed of feeds) {
|
2019-04-29 23:36:04 +03:00
|
|
|
await beanstalkd.put(feed.feed)
|
|
|
|
}
|
|
|
|
|
|
|
|
await beanstalkd.disconnect()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2024-10-02 16:53:07 +03:00
|
|
|
foo();
|