Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix YadVaShem new Design #119

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

GuyKh
Copy link
Collaborator

@GuyKh GuyKh commented May 28, 2024

Solves #118

Basically - changed the logic to the following:

  1. Load from the page the selected record ID (by using the parsed page)
  2. Call the YadVaShem API with the language (from the URL) and the ItemID
  3. Convert the returned json to an object
  4. Go over the object fields to extract data

e.g.
for https://collections.yadvashem.org/en/names/14035251
call (step 2) to: https://yv360.yadvashem.org/api/Names/GetSingleFullDetails?id=1100850&lang=en&source=Page%20of%20Testimony

response is in the following format:

{
    "details": [
        {
            "tag": null,
            "id": "YSLN",
            "value": "Epsztein",
            "url": ""
        },
        {
            "tag": null,
            "id": "YSLN",
            "value": "Epshtein",
            "url": ""
        },
        {
            "tag": null,
            "id": "YSFN",
            "value": "Abram",
            "url": ""
        },
        {
            "tag": null,
            "id": "YSFN",
            "value": "Avraham",
            "url": ""
        },
        {
            "tag": null,
            "id": "GENDER",
            "value": "Male",
            "url": ""
        },...

Then, convert the details list to an object by using a id to field_name mapping, with value from value.
Then parse it.

Also - since they may be duplicates, take the first value.

Bonus:
Refactor addEventData to a common class.

Other things to add (probably in a different PR) - the ability to fetch an image.

@GuyKh GuyKh added the bug label May 28, 2024
@GuyKh GuyKh assigned GuyKh and unassigned eljeffeg May 28, 2024
@GuyKh GuyKh requested a review from eljeffeg May 28, 2024 06:12
@GuyKh GuyKh linked an issue May 28, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix YadVaShem new Design
2 participants