Static Member Summary
Static Private Members | ||
private static |
A map of the installed plugins. |
Static Method Summary
Static Public Methods | ||
public static |
use(Plugin: Function, args: Object): Promise<PopApiScraper> Register middleware for the PopApi framework. |
Constructor Summary
Public Constructor | ||
public |
constructor(PopApi: PopApi, options: Object) Create a new BaseScraper object. |
Member Summary
Public Members | ||
public |
The context to execute the providers in. |
|
public |
The path of the status file. |
|
public |
The path of the updated file. |
Method Summary
Public Methods | ||
public |
Get the status object. |
|
public |
getUpdated(): Promise<number, Error> Get the updated object. |
|
public |
Initiate the scraping. |
|
public |
Updates the |
|
public |
setUpdated(updated: number): Promise<undefined, Error> Updates the |
Static Public Methods
public static use(Plugin: Function, args: Object): Promise<PopApiScraper> source
Register middleware for the PopApi framework.
Public Constructors
public constructor(PopApi: PopApi, options: Object) source
Create a new BaseScraper object. The base modules for popcorn-api
Params:
Name | Type | Attribute | Description |
PopApi | PopApi |
|
The PopApiScraper instance. |
options | Object |
|
The options for the BaseScraper middleware. |
options.statusPath | string |
|
= - The path of the status file. |
options.updatedPath | string |
|
The path of the updated file. |
Public Members
Public Methods
public async scrape(concurrency: number): Promise<Array<Object>, Error> source
Initiate the scraping.
Params:
Name | Type | Attribute | Description |
concurrency | number |
|
How many providers to scrape concurrently. |
public setStatus(status: string): Promise<undefined, Error> source
Updates the status.json
file.
Params:
Name | Type | Attribute | Description |
status | string |
|
The status which will be set to in the
|