Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Addition of '&filter=0' in search query #3

Merged
merged 1 commit into from

2 participants

@lucasvall

I have added '&filter=0' to the query to force all results with large offsets (specially after 500 or so results).

@lucasvall lucasvall Addition of '&filter=0' in search query
I have added '&filter=0' to the query to force all results with large offsets (specially after 500 or so results).
ab71706
@chrisle chrisle merged commit 92587da into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 5, 2012
  1. @lucasvall

    Addition of '&filter=0' in search query

    lucasvall authored
    I have added '&filter=0' to the query to force all results with large offsets (specially after 500 or so results).
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  google_scraper.js
View
3  google_scraper.js
@@ -37,6 +37,7 @@ var SeerJs_GoogleScraper = (function() {
* @param {array} optResults (Optional) Number of results to return (defaults to 10)
* @param {string} optTld (Optional) Top level domain (eg: ".co.uk". Defaults to ".com")
* @param {string} optStart (Optional) Sets the starting offset for results (defaults to 0)
+ * filter=0 Force all results from Google. Important when using large offset
*/
function fetch(kw, optResults, optTld, optStart) {
errorOccurred = false;
@@ -44,7 +45,7 @@ var SeerJs_GoogleScraper = (function() {
optStart = optStart || 0;
optTld = optTld || '.com';
try {
- var url = 'http://www.google' + optTld + '/search?q=' + kw + '&start=' + optStart + '&num=' + optResults;
+ var url = 'http://www.google' + optTld + '/search?q=' + kw + '&start=' + optStart + '&num=' + optResults + '&filter=0';
return UrlFetchApp.fetch(url).getContentText()
} catch(e) {
errorOccurred = true;
Something went wrong with that request. Please try again.