-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
50 lines (31 loc) · 1.07 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//require("./fetchNewLinks/index_fetchNewLinks")
try {
require("dotenv").config()
} catch(e) { console.log(e) }
let MONGODB_URL = process.env.MONGODB_URL
const Database = require("./fetchNewLinks/databaseParser.js")
const MongoClient = require('mongodb').MongoClient;
const logger = {
info: (...args) => { console.log(...args) },
}
const DOMParser = require("dom-parser")
const axios = require("axios")
logger.info("=======================================")
logger.info("========== [Starting script] ==========")
logger.info("=======================================")
let url = MONGODB_URL
logger.info("Tentative de connection à MongoDB...")
MongoClient.connect(url, function(err, Mongo) {
if(err) throw err
Database._setMongoClient(Mongo)
Database._useDb("dibim")
logger.info(" Mongo instance connected.")
_allCode()
})
async function _allCode() {
let server = require("./server")
server.run()
//var result = await Database.getAllLinksByKeywords(["bot"])
var result = (await Database.getAllLinks_notChecked())
//console.log("recherche:",result)
}