Working RSS Feed Manager

- Auto updates feeds
- Sends updates to specified channels
- Needs threading
This commit is contained in:
Logan Cusano
2023-02-25 20:56:01 -05:00
parent d33f1ceccc
commit 3266a1550e
4 changed files with 44 additions and 15 deletions

View File

@@ -0,0 +1,26 @@
//Will handle updating feeds in all channels
const { DebugBuilder } = require("../utilities/debugBuilder");
const log = new DebugBuilder("server", "rssController");
const libCore = require("../libCore");
const libUtils = require("../libUtils");
exports.RSSController = class RSSController {
constructor(_client) {
this.client = _client;
}
async start(){
log.INFO("Starting RSS Controller");
while(true){
await new Promise(resolve => setTimeout(resolve, 10000));
this.collectLatestPosts();
}
}
async collectLatestPosts(){
log.INFO("Updating sources");
libCore.updateFeeds(this.client)
}
}