-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.js
52 lines (40 loc) · 1.02 KB
/
app.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
51
52
/**
* This class will scrape wikipedia articles and build out of it a datamase which can be searched in a semantic way.
* The density count of keywords in a small local place (textblock) allows us to detect related keywords in a semantic way
*
* @author Michael Klein <[email protected]>
* @url http://open-semantic.com/
* @package opensemanticapi
* @version 0.1
*/
/**
* laod config
*/
var config = require('./config');
/**
* Basic Objects
*/
// our basic app object
var App = function() {};
// our basic app
var app = new App();
var Model = require('./app/model');
App.prototype.getModel = function(s) {
return new Model(s);
};
// var test = app.getModel('test');
// console.log(test.getValue());
if(!config.creds.http_server) {
var Scraper = require("./app/scraping");
var scraper = new Scraper();
// Start Cronjob
scraper.wikiSearch('database');
}
/**
* Server
*/
// Start HTTP API RESTFUL Server
if(config.creds.http_server) {
var Http = require("./app/http");
var http = new Http();
}