Added birthday to Bang actor scraper.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
const bhttp = require('bhttp');
|
||||
|
||||
const { post } = require('../utils/http');
|
||||
const slugify = require('../utils/slugify');
|
||||
const { extractDate } = require('../utils/qu');
|
||||
const { inchesToCm } = require('../utils/convert');
|
||||
const slugify = require('../utils/slugify');
|
||||
|
||||
const clusterId = '617fb597b659459bafe6472470d9073a';
|
||||
const authKey = 'YmFuZy1yZWFkOktqVDN0RzJacmQ1TFNRazI=';
|
||||
@@ -87,6 +88,7 @@ function scrapeProfile(actor) {
|
||||
const profile = {};
|
||||
|
||||
profile.aliases = actor.aliases;
|
||||
profile.dateOfBirth = extractDate(actor.birthDate);
|
||||
profile.gender = ({ F: 'female', M: 'male' })[actor.gender];
|
||||
|
||||
profile.ethnicity = actor.ethnicity;
|
||||
|
||||
Reference in New Issue
Block a user