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

Method Comment() doesn't work #258

Closed
jcvignoli opened this issue Aug 20, 2021 · 4 comments
Closed

Method Comment() doesn't work #258

jcvignoli opened this issue Aug 20, 2021 · 4 comments

Comments

@jcvignoli
Copy link

I tried to get comment() working, without luck.

Seems like the method is not retrieving the main user comment as it used to.

Pretty sure the method was working a few weeks ago.

@tboothman
Copy link
Owner

tboothman commented Oct 23, 2021

Do you have a description of how you'd like this method to work? There aren't any tests and it doesn't really look like it works how i would (perhaps) like. It appears to preserve html and keep links. Does it keep the review summary/title?

@tboothman
Copy link
Owner

tboothman commented Oct 23, 2021

This returns what I think is the text content of the review body with all the html stripped:

    public function comment()
    {
        if ($this->main_comment == "") {
            $t = $this->getXpathPage('Title');
            $reviewRaw = $t->query("//div[@data-testid='review-overflow']/div/div");
            $this->main_comment = $reviewRaw->item(0)->textContent;
        }
        return $this->main_comment;
    }

image
ends up as
'At first, I wasn\'t interested in seeing the Matrix. But after hardly hearing any bad reviews for it (and believe me, I hear bad reviews for every movie I enjoy) I decided to give it a try. At first, although I really loved the fights, graphics and characters, the plot confused me. (Anyone confused by the plot at all should go to www.knowthematrix.com and you\'ll find out everything you could want to know) By the second time I watched it, I really understood it, which made the movie even more enjoyable.I really loved this movie. Just about every character, good or bad, is very interesting and cool. The acting was excellent. Even though I think this was Keanu Reeves at his best, the best acting jobs were done by Laurence Fishburne (Morpheus) and Carrie-Anne Moss (Trinity). Hugo Weaving did an excellent job as Agent Smith and Joe Pantoliano was great as Cypher as well.The plot is one of the best movie plots I\'ve seen in a movie. An accountant by day, computer hacker by night guy suddenly finds out that reality as we know it is fake and that we are actually in a giant computer program run by robots (that we created, of course) in order for them to get power. Not only that, but he finds out that he is one who is, according to prophecy, going to put an end to it. The greatest thing is that you learn things just as Neo does, so you can really relate to his character.My favorite thing about this movie is that no matter how many times you watch it, you will learn more about it. I guarantee this. Some may not like this movie because the plot is too complicated, but I recommend that anyone who enjoys movies should go buy this one right away.'

@jcvignoli
Copy link
Author

Well, if using imdphp demo, which includes comment() function, doesn't work.
Try searching for "2001, a space odyssey", no comment is returned. Same goes for every movie I tried.

@tboothman
Copy link
Owner

Sorry I should've been clearer. The current code does not work, and likely stopped working when the imdb site was redesigned. It looks like the current code would have html and all sorts of rubbish.
My second comment proposed some different code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants