moved from pushover to my own gotify server

This commit is contained in:
Martin Donnelly 2022-06-22 11:00:50 +01:00
parent 7e32e3974d
commit 9b1f400c11
4 changed files with 3203 additions and 9 deletions

View File

@ -1,7 +1,7 @@
const loader = require('../libs/loader');
const lot = require('../libs/lot');
const lotv2 = require('../libs/lotV2');
const pusher = require('../libs/pusher');
const gotify = require('../libs/gotify');
const log4js = require('log4js');
const logger = log4js.getLogger();
@ -16,7 +16,7 @@ V1: ${v1.mainline} stars: ${v1.mainstars}
Other: ${v1.otherLine} stars: ${v1.otherStars}
`;
pusher.push(msg);
gotify.push(msg);
logger.debug(msg);
// loader.save(data);
}

20
libs/gotify.js Normal file
View File

@ -0,0 +1,20 @@
const gotify = require('jotify');
gotify.url = 'https://push.caliban.io';
gotify.token = 'A_OY8j2kRWJOJig';
gotify.priority = 7;
const prefix = process.env.NODE_ENV === 'production' ? 'Production' : 'Dev';
const title = `mdLot ${ prefix } Alert`;
module.exports = {
'push' : function(contents) {
const now = new Date();
const msg = `Updated at ${new Date(now).toLocaleString()}\n\n${contents}`;
gotify.send(title, msg);
}
};

3187
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -24,6 +24,7 @@
"dependencies": {
"cheerio": "^1.0.0-rc.2",
"fecha": "^4.2.3",
"jotify": "^1.0.2",
"log4js": "^6.4.6",
"node-fetch": "^3.2.4",
"node-pushover": "^1.0.0",