Added Reality Kings scraper. Improved site finder.

This commit is contained in:
2019-04-08 01:49:45 +02:00
parent 34baa092ba
commit d526e4daea
15 changed files with 649 additions and 71 deletions

View File

@@ -12,11 +12,11 @@ function scrapeLatest(html, site) {
const sceneElements = $('.scenes-latest').toArray();
return sceneElements.map((element) => {
const actors = $('.actors a').map((actorIndex, actorElement) => $(actorElement).text()).toArray();
const actors = $(element).find('.actors a').map((actorIndex, actorElement) => $(actorElement).text()).toArray();
return {
url,
shootId,
entryId,
title,
actors,
date,
@@ -35,11 +35,11 @@ function scrapeUpcoming(html, site) {
const sceneElements = $('.scenes-upcoming').toArray();
return sceneElements.map((element) => {
const actors = $('.actors a').map((actorIndex, actorElement) => $(actorElement).text()).toArray();
const actors = $(element).find('.actors a').map((actorIndex, actorElement) => $(actorElement).text()).toArray();
return {
url,
shootId,
entryId,
title,
actors,
date,
@@ -56,9 +56,6 @@ function scrapeUpcoming(html, site) {
async function scrapeScene(html, url, site) {
const $ = cheerio.load(html, { normalizeWhitespace: true });
const rawTags = [];
const tags = await matchTags(rawTags);
const actors = $('.actors a').map((actorIndex, actorElement) => $(actorElement).text()).toArray();
const rawTags = $('.tags a').map((tagIndex, tagElement) => $(tagElement).text()).toArray();
@@ -66,7 +63,7 @@ async function scrapeScene(html, url, site) {
return {
url,
shootId,
entryId,
title,
description,
actors,