diff --git a/src/wikitree.ts b/src/wikitree.ts index 1c4f90d..eecf060 100644 --- a/src/wikitree.ts +++ b/src/wikitree.ts @@ -40,6 +40,9 @@ interface Person { BirthDate: string; DeathDate: string; }; + PhotoData?: { + path: string; + }; } /** Sends a request to the WikiTree API. Returns the parsed response JSON. */ @@ -245,6 +248,9 @@ function convertPerson(person: Person): JsonIndi { ); indi.death = Object.assign({}, parsedDate, {place: person.DeathLocation}); } + if (person.PhotoData) { + indi.images = [{url: `https://wikitree.com${person.PhotoData.path}`}]; + } return indi; }