eljeffeg / SmartCopy

Chrome extension for copying genealogical data into Geni.com.
15 stars 14 forks source link

New Billion Graves design update #117

Closed GuyKh closed 4 months ago

GuyKh commented 4 months ago

TL;DR for every profile - (e.g. Thomas F Krysinski) there's a part of the HTML with a json with the details.

<script type="application/ld+json">
{
    "@context": "https://schema.org",
    "@type": "Person",
    "@id": "https://billiongraves.com/grave/Thomas-F-Krysinski/32465201",
    "url": "https://billiongraves.com/grave/Thomas-F-Krysinski/32465201",
    "name": "Thomas F. Krysinski",
    "familyName": "Krysinski",
    "givenName": "Thomas F.",
    "birthDate": "1945",
    "deathDate": "1992-12",
    "image": "https://billiongraves.com/api/1.4/selectimage?tkn=med26842274&p1=128&p2=0",
    "deathPlace": {
        "@context": "https://schema.org",
        "@type": "Cemetery",
        "name": "Holy Cross Catholic Cemetery",
        "@id": "https://billiongraves.com/cemetery/Holy-Cross-Catholic-Cemetery/21305",
        "url": "https://billiongraves.com/cemetery/Holy-Cross-Catholic-Cemetery/21305",
        "geo": {
            "@type": "GeoCoordinates",
            "latitude": 41.60675535448,
            "longitude": -87.546876864589
        },
        "address": {
            "@type": "PostalAddress",
            "addressLocality": "Calumet City",
            "addressRegion": "Illinois",
            "addressCountry": "United States"
        }
    }
}
</script>

Load this and use it instead of HTML parsing - this way -- add support to new BillionGraves

Solves #116 , Solves #106

eljeffeg commented 4 months ago

The dates didn't parse correctly for me in the Thomas Krysinski example. The normal JS date parse will assume dates and it works off a 0-11 month calculation if I recall. In any case, when I parse Thomas, it gives me these dates. Birth: December 31, 1944, Death: November 30, 1992, when the real info is 1945 - December 1992.

I'd suggest maybe trying to use the parseDate function in the popup.js and if you wanted to format it.. maybe something like this?


function displayDate(vardate) {
    let formattedDate = ""
    if ("day" in vardate && "month" in vardate && "year" in vardate) {
        let date = moment({ year: vardate["year"], month: vardate["month"] - 1 , day: vardate["day"] });
        formattedDate = date.format("MMMM D, YYYY");
    } else if ("month" in vardate && "year" in vardate) {
        let date = moment({ year: vardate["year"], month: vardate["month"] - 1 })
        formattedDate = date.format("MMMM YYYY");
    } else if ("year" in vardate){
        let date = moment({ year: vardate["year"]});
        formattedDate = date.format("YYYY");
    }
    return formattedDate;
}```
GuyKh commented 4 months ago

Perhaps it takes into account some locale of the browser

GuyKh commented 4 months ago

@eljeffeg see changes

GuyKh commented 4 months ago

By the way, Interesting thing to find: there's a github extension for WikiTree - where they face the same problems as we do: wikitree-sourcer

Worth taking a look when thinking about other problems too

GuyKh commented 4 months ago

@eljeffeg i think it's ready

eljeffeg commented 4 months ago

Whoops, cross the streams on my work account. I'll take a look this weekend. Are we ready with #115 & #112 as well or holding off on them?

GuyKh commented 4 months ago

Whoops, cross the streams on my work account. I'll take a look this weekend. Are we ready with #115 & #112 as well or holding off on them?

No.

115 is blocked due to not being able to fetch urls for family members and so can't add them

112 is also blocked, some work needs to be done there on a deeper level

GuyKh commented 4 months ago

@eljeffeg - requesting your attention :)