Improved actor profile flow. Added images.

This commit is contained in:
2020-01-23 03:52:12 +01:00
parent c9b8a18db5
commit 9db0e97512
23 changed files with 104 additions and 54 deletions

View File

@@ -119,17 +119,12 @@ async function scrapeProfile(html, _url, actorName) {
const descriptionEl = document.querySelector('.description-box');
const avatarEl = document.querySelector('.pornstar-details .card-img-top');
const country = await knex('countries')
.where('nationality', 'ilike', `%${bio.Nationality}%`)
.orderBy('priority', 'desc')
.first();
const profile = {
name: actorName,
};
profile.birthdate = moment.utc(bio.Birthday, 'MMMM DD, YYYY').toDate();
if (country) profile.birthPlace = country.name;
if (bio.Nationality) profile.nationality = bio.Nationality;
if (bio['Bra size']) [profile.bust] = bio['Bra size'].match(/\d+\w+/);
if (bio.Waist) profile.waist = Number(bio.Waist.match(/\d+/)[0]);