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

How can i skip some results? #55

Open
Nisthar opened this issue Aug 4, 2017 · 1 comment
Open

How can i skip some results? #55

Nisthar opened this issue Aug 4, 2017 · 1 comment

Comments

@Nisthar
Copy link

Nisthar commented Aug 4, 2017

I want to skip some results that i already visited. How can i skip some results based on a condition in my code?

@tpickett
Copy link
Contributor

If you need to offset the results that are returned, then just pass the optional "start" parameter into the google function.
This will return from the 3rd page of results:

google ('test query', 20, ( err, res ) => {
  if (err) console.error(err)

  for (var i = 0; i < res.links.length; ++i) {
    var link = res.links[i];
    console.log(link.title + ' - ' + link.href)
    console.log(link.description + "\n")
  }

  if (nextCounter < 4) {
    nextCounter += 1
    if (res.next) res.next()
  }
})

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