Added birthday to Bang actor scraper.

This commit is contained in:
2020-05-17 05:08:41 +02:00
parent f42ca7bd52
commit 61965d480c
3 changed files with 12 additions and 7 deletions

View File

@@ -152,9 +152,11 @@ async function curateProfile(profile) {
|| (/trans/i.test(profile.gender) && 'transsexual')
|| null;
curatedProfile.dateOfBirth = (!Number.isNaN(Number(profile.dateOfBirth || profile.birthdate)) // possibly valid date
&& new Date() - profile.birthdate > 567648000000 // over 18
&& profile.birthdate)
const dateOfBirth = profile.dateOfBirth || profile.birthdate;
curatedProfile.dateOfBirth = (!Number.isNaN(Number(dateOfBirth)) // possibly valid date
&& new Date() - dateOfBirth > 567648000000 // over 18
&& dateOfBirth)
|| null;
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_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_state = getMostFrequent(valuesByProperty.birth_state);
profile.birth_country_alpha2 = getMostFrequent(valuesByProperty.birth_country_alpha2);