forked from DebaucheryLibrarian/traxxx
Added birthday to Bang actor scraper.
This commit is contained in:
parent
f42ca7bd52
commit
61965d480c
|
@ -75,7 +75,10 @@
|
||||||
>
|
>
|
||||||
<dfn class="bio-label"><Icon icon="christian-cross" />Date of death</dfn>
|
<dfn class="bio-label"><Icon icon="christian-cross" />Date of death</dfn>
|
||||||
|
|
||||||
<span class="birthdate">{{ formatDate(actor.dateOfDeath, 'MMMM D, YYYY') }}<span class="age">{{ actor.ageAtDeath }}</span></span>
|
<span class="birthdate">{{ formatDate(actor.dateOfDeath, 'MMMM D, YYYY') }}<span
|
||||||
|
v-if="actor.ageAtDeath"
|
||||||
|
class="age"
|
||||||
|
>{{ actor.ageAtDeath }}</span></span>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li
|
<li
|
||||||
|
|
|
@ -152,9 +152,11 @@ async function curateProfile(profile) {
|
||||||
|| (/trans/i.test(profile.gender) && 'transsexual')
|
|| (/trans/i.test(profile.gender) && 'transsexual')
|
||||||
|| null;
|
|| null;
|
||||||
|
|
||||||
curatedProfile.dateOfBirth = (!Number.isNaN(Number(profile.dateOfBirth || profile.birthdate)) // possibly valid date
|
const dateOfBirth = profile.dateOfBirth || profile.birthdate;
|
||||||
&& new Date() - profile.birthdate > 567648000000 // over 18
|
|
||||||
&& profile.birthdate)
|
curatedProfile.dateOfBirth = (!Number.isNaN(Number(dateOfBirth)) // possibly valid date
|
||||||
|
&& new Date() - dateOfBirth > 567648000000 // over 18
|
||||||
|
&& dateOfBirth)
|
||||||
|| null;
|
|| null;
|
||||||
|
|
||||||
curatedProfile.dateOfDeath = Number.isNaN(Number(profile.dateOfDeath)) ? null : profile.dateOfDeath;
|
curatedProfile.dateOfDeath = Number.isNaN(Number(profile.dateOfDeath)) ? null : profile.dateOfDeath;
|
||||||
|
@ -255,8 +257,6 @@ async function interpolateProfiles(actors) {
|
||||||
profile.date_of_birth = getMostFrequentDate(valuesByProperty.date_of_birth);
|
profile.date_of_birth = getMostFrequentDate(valuesByProperty.date_of_birth);
|
||||||
profile.date_of_death = getMostFrequentDate(valuesByProperty.date_of_death);
|
profile.date_of_death = getMostFrequentDate(valuesByProperty.date_of_death);
|
||||||
|
|
||||||
console.log(valuesByProperty.date_of_birth, profile.date_of_birth);
|
|
||||||
|
|
||||||
profile.birth_city = getMostFrequent(valuesByProperty.birth_city);
|
profile.birth_city = getMostFrequent(valuesByProperty.birth_city);
|
||||||
profile.birth_state = getMostFrequent(valuesByProperty.birth_state);
|
profile.birth_state = getMostFrequent(valuesByProperty.birth_state);
|
||||||
profile.birth_country_alpha2 = getMostFrequent(valuesByProperty.birth_country_alpha2);
|
profile.birth_country_alpha2 = getMostFrequent(valuesByProperty.birth_country_alpha2);
|
||||||
|
|
|
@ -3,8 +3,9 @@
|
||||||
const bhttp = require('bhttp');
|
const bhttp = require('bhttp');
|
||||||
|
|
||||||
const { post } = require('../utils/http');
|
const { post } = require('../utils/http');
|
||||||
const slugify = require('../utils/slugify');
|
const { extractDate } = require('../utils/qu');
|
||||||
const { inchesToCm } = require('../utils/convert');
|
const { inchesToCm } = require('../utils/convert');
|
||||||
|
const slugify = require('../utils/slugify');
|
||||||
|
|
||||||
const clusterId = '617fb597b659459bafe6472470d9073a';
|
const clusterId = '617fb597b659459bafe6472470d9073a';
|
||||||
const authKey = 'YmFuZy1yZWFkOktqVDN0RzJacmQ1TFNRazI=';
|
const authKey = 'YmFuZy1yZWFkOktqVDN0RzJacmQ1TFNRazI=';
|
||||||
|
@ -87,6 +88,7 @@ function scrapeProfile(actor) {
|
||||||
const profile = {};
|
const profile = {};
|
||||||
|
|
||||||
profile.aliases = actor.aliases;
|
profile.aliases = actor.aliases;
|
||||||
|
profile.dateOfBirth = extractDate(actor.birthDate);
|
||||||
profile.gender = ({ F: 'female', M: 'male' })[actor.gender];
|
profile.gender = ({ F: 'female', M: 'male' })[actor.gender];
|
||||||
|
|
||||||
profile.ethnicity = actor.ethnicity;
|
profile.ethnicity = actor.ethnicity;
|
||||||
|
|
Loading…
Reference in New Issue