Working RSS Feed Manager
- Auto updates feeds - Sends updates to specified channels - Needs threading
This commit is contained in:
26
controllers/rssController.js
Normal file
26
controllers/rssController.js
Normal 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user