-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
38 lines (38 loc) · 1.29 KB
/
index.d.ts
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
import express = require('express');
import calais = require('calais-entity-extractor');
/** Options */
export declare class NewsSourceOptions {
/** If true, set headers to enable CORRS. */
corrs: boolean;
/** source folder. If not set, uses ./newsfeatures */
newsFolder: string;
calaisApi: string;
alchemyApi: string;
keywords: string[];
updateInterval: number;
}
export declare class NewsSource {
private options;
private alchemyFeed;
private calaisSource;
constructor(app: express.Express, options?: NewsSourceOptions);
/** Processes a data object containing news items */
private processNews(data);
/** Adds (geographic) information to news items using the OpenCalais source*/
private contactCalais(items);
}
export declare class AlchemyFeed {
private apiKey;
private keywords;
constructor(app: express.Express, apiKey: string);
getNewsText(keywords: string | string[], count: number, clbk: Function): void;
private performRequest(url, cb);
}
export declare class CalaisSource {
private oc;
constructor(app: express.Express, apiKey: string, options?: calais.ICalaisOptions);
getNewsFeatures(content: string, cb: Function): void;
private parseResult(res);
private parseEntity(item);
private parseRelation(item);
}