-
Notifications
You must be signed in to change notification settings - Fork 84
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
Fixed method Spouse #275
Fixed method Spouse #275
Conversation
Spouse didn´t work at all, it should be fixed. it took me 2 weeks to cover all the different kinds of data so i hope it will work in all cases.
I must say that this method is also needlessly complicated. |
@Thomasdouscha confirmed that this is working |
Fixed bug when family part is not available on bio page and no spouse data either. this leads to error Trying to get property 'nodeValue' of non-object
Looks good 👍 |
Thanks for merging, it was a pain in the back to make it work, lets hope that imdb don't change it.. |
Well yes i agree with your argument that reducing to string is not the point of this library but that can make it difficult to maintain |
Hah, yes. Well that's why when I noticed my very loose test of 'it returns something' started failing I opted to just ignore this method. Crazy complicated code |
Basically the code is complicated because imdb does not separate the data in html tags like span, p or even li. They just dumps it in a td. If i could find where that data is coming from would made my life a lot easier haha |
Well ... imdb does have a graphql api that has a ton of data in it. https://api.graphql.imdb.com/ query Person($id: ID!) {
name(id: $id) {
nameText {
text
}
spouses {
current
attributes {
text
language {
id
text
}
}
timeRange {
fromDate {
dateComponents {
year
month
day
}
}
toDate {
dateComponents {
year
month
day
}
}
}
spouse {
name {
id
nameText {
text
}
}
}
}
}
}
{
"data": {
"name": {
"nameText": {
"text": "Robin Williams"
},
"spouses": [
{
"current": false,
"attributes": [
{
"text": "his death",
"language": {
"id": "en-US",
"text": "English (United States)"
}
}
],
"timeRange": {
"fromDate": {
"dateComponents": {
"year": 2011,
"month": 10,
"day": 22
}
},
"toDate": {
"dateComponents": {
"year": 2014,
"month": 8,
"day": 11
}
}
},
"spouse": {
"name": {
"id": "nm6699367",
"nameText": {
"text": "Susan Schneider"
}
}
}
},
{
"current": false,
"attributes": [
{
"text": "divorced",
"language": {
"id": "en-US",
"text": "English (United States)"
}
},
{
"text": "2 children",
"language": {
"id": "en-US",
"text": "English (United States)"
}
}
],
"timeRange": {
"fromDate": {
"dateComponents": {
"year": 1989,
"month": 4,
"day": 30
}
},
"toDate": {
"dateComponents": {
"year": 2010,
"month": null,
"day": null
}
}
},
"spouse": {
"name": {
"id": "nm0931265",
"nameText": {
"text": "Marsha Garces Williams"
}
}
}
},
{
"current": false,
"attributes": [
{
"text": "divorced",
"language": {
"id": "en-US",
"text": "English (United States)"
}
},
{
"text": "1 child",
"language": {
"id": "en-US",
"text": "English (United States)"
}
}
],
"timeRange": {
"fromDate": {
"dateComponents": {
"year": 1978,
"month": 6,
"day": 4
}
},
"toDate": {
"dateComponents": {
"year": 1988,
"month": 12,
"day": 6
}
}
},
"spouse": {
"name": {
"id": "nm0892239",
"nameText": {
"text": "Valerie Velardi"
}
}
}
}
]
}
}
} |
Looks interesting but i don't have a account so can't see/use it. |
Fixed this method, it took me about 2 weeks to cover all different kinds of data so i hope it will work in all cases.
Added test for this method.
@tboothman can you test this method and the test that i made?
It was very, very hard to get al data and separate it in the correct array elements. Re done this method 3 times and i hope it is in a working enough state