mirror of
https://github.com/karl0ss/JDRssDownloader.git
synced 2025-04-27 03:49:23 +01:00
21 lines
813 B
JavaScript
21 lines
813 B
JavaScript
const fs = require("fs");
|
|
const { feedUpdater } = require('./FeedUpdater')
|
|
const { filterFeed } = require('./FeedFilter')
|
|
global.log = require('simple-node-logger').createSimpleLogger({
|
|
logFilePath: 'jdrssdownloader.log',
|
|
timestampFormat: 'YYYY-MM-DD HH:mm:ss.SSS'
|
|
});
|
|
|
|
async function main() {
|
|
let RSSFeedRefreshMins = JSON.parse(fs.readFileSync('config.json')).RSSFeedRefreshMins
|
|
let JDPostLinksMins = JSON.parse(fs.readFileSync('config.json')).JDPostLinksMins
|
|
|
|
log.info('Refreshing RSS Items every ' + RSSFeedRefreshMins + ' Minutes')
|
|
log.info('Checking for links and sending to JDdownloader every ' + JDPostLinksMins + ' Minutes')
|
|
|
|
|
|
setInterval(await feedUpdater, RSSFeedRefreshMins * 60000);
|
|
setInterval(await filterFeed, JDPostLinksMins * 60000);
|
|
}
|
|
|
|
main() |