* Various Changes
This commit is contained in:
parent
e9a2f3d488
commit
9acbd6b93f
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,15 @@
|
|||
import { Post, Tag, LogEntry, LogType } from "../type/generic";
|
||||
import { Scrapper } from "../class/Scrapper";
|
||||
import { getPageContents } from "../helper/requestManager";
|
||||
import * as cheerio from 'cheerio';
|
||||
|
||||
export class Rule34xxx extends Scrapper {
|
||||
|
||||
constructor() {
|
||||
// Set the domain base of the current Scrapper as "twitter.com"
|
||||
super("https://twitter.com");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -3,4 +3,4 @@ import {runTest as runRule34XXX} from "./test/rule34xxx";
|
|||
console.log(`Testing Rule34.xxx`);
|
||||
|
||||
// Running the rule34 test with "Most popular" page
|
||||
runRule34XXX(`https://rule34.xxx/index.php?page=post&s=list&tags=cyancapsule`, 30);
|
||||
runRule34XXX(`https://rule34.xxx/index.php?page=post&s=list&tags=-male%2fmale+-furry+-yaoi+-male_focus+-male_only+-anthro+-3d+-cum+-my_little_pony+-vore+-unknown_species+-fur+-animal`, 50);
|
|
@ -34,7 +34,7 @@ export async function runTest(startingPage: string = `https://rule34.xxx/index.p
|
|||
/**
|
||||
* The definitive list of posts
|
||||
*/
|
||||
const postList: Array<Post> = [];
|
||||
let postList: Array<Post> = [];
|
||||
|
||||
/**
|
||||
* The amount of posts to fetch per cycle
|
||||
|
@ -54,7 +54,7 @@ export async function runTest(startingPage: string = `https://rule34.xxx/index.p
|
|||
.then( result => {
|
||||
// Append the results to the postList
|
||||
for ( let p of result ) {
|
||||
if ( (p as any).value !== null ) {
|
||||
if ( (p as any).value != null ) {
|
||||
postList.push(((p as any).value as Post));
|
||||
}
|
||||
}
|
||||
|
@ -69,6 +69,9 @@ export async function runTest(startingPage: string = `https://rule34.xxx/index.p
|
|||
|
||||
console.log(`Done!`);
|
||||
|
||||
// Reverse sort them
|
||||
postList = postList.reverse();
|
||||
|
||||
await fs.writeFile(`./export/r34xxx_pageList_example.json`, JSON.stringify(pageList, null, 4));
|
||||
await fs.writeFile(`./export/r34xxx_postLinks_example.json`, JSON.stringify(postLinks, null, 4));
|
||||
await fs.writeFile(`./export/r34xxx_postList_example.json`, JSON.stringify(postList, null, 4));
|
||||
|
|
Reference in New Issue