This repository has been archived on 2024-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
2021-10-21 01:23:48 +03:00
|
|
|
import {Post, Tag} from "../type/generic";
|
2021-10-21 01:10:27 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The base class of the scrappers, any of the website scrappers must extend this class
|
|
|
|
*/
|
2021-10-21 01:23:48 +03:00
|
|
|
export class Scrapper {
|
|
|
|
|
|
|
|
constructor(domain: string) {
|
|
|
|
// Set the domain
|
|
|
|
this.domain = domain;
|
|
|
|
};
|
2021-10-21 01:10:27 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* An array of all of the logs
|
|
|
|
*/
|
|
|
|
public logs: Array<any> = [];
|
|
|
|
|
2021-10-21 01:23:48 +03:00
|
|
|
/**
|
|
|
|
* The fully qualified domain of the website to scrap, for example "rule34.life"
|
|
|
|
*/
|
|
|
|
public domain: string = ``;
|
|
|
|
|
2021-10-21 01:10:27 +03:00
|
|
|
/**
|
|
|
|
* Get the details of a specific post
|
|
|
|
* @param url The URL to the post, this must be the actual page which contains the image, tags, etc...
|
|
|
|
*/
|
2021-10-21 01:23:48 +03:00
|
|
|
public async getPostDetails( url: string ): Promise<Post | null> {
|
|
|
|
return null;
|
2021-10-21 01:10:27 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get a list of posts from the mentioned page
|
|
|
|
* @param url
|
|
|
|
* @returns
|
|
|
|
*/
|
2021-10-21 01:23:48 +03:00
|
|
|
public async getPostsFromPage( url: string ): Promise<Array<Post>> {
|
2021-10-21 01:10:27 +03:00
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|