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

Top Stories - incorrect documentation and no results #122

Open
MrZANO opened this issue Aug 8, 2019 · 0 comments
Open

Top Stories - incorrect documentation and no results #122

MrZANO opened this issue Aug 8, 2019 · 0 comments

Comments

@MrZANO
Copy link

MrZANO commented Aug 8, 2019

Goodmorning everyone,
I point out that the documentation is wrong, there are no brackets ")" and the array management is incorrect
$newsTitle = $title;
to
$newsTitle = $news->title;
the complete code generated by me to get the results of the word "homicide" is as follows

if ($result->is(NaturalResultType::TOP_STORIES)) {
                foreach ($result->news as $news) {
                    if ($news->is(NaturalResultType::TOP_STORIES_NEWS_CAROUSEL)) {
                        // carousel
                        $newsTitle = $news->title;
                        $newsUrl = $news->url;
                        echo "TOP_STORIES_NEWS_CAROUSEL-->" . $newsUrl . " " . $newsTitle;
                    } elseif ($news->is(NaturalResultType::TOP_STORIES_NEWS_VERTICAL)) {
                        // vertical
                        $newsTitle = $news->title;
                        $newsUrl = $news->url;
                        echo "TOP_STORIES_NEWS_VERTICAL-->" . $newsUrl . " " . $newsTitle;
                    }
                }
            }

ma nonostante ci siano "top stories" in SERPs non ottengo mai il parser dei risultati (bug?)

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

1 participant