Permalink
Browse files

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).
  • Loading branch information...
1 parent 26e195b commit ab7170627ec494f555ac9dc5d40b811e13a41ac8 @lucasvall lucasvall committed Nov 5, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 google_scraper.js
View
3 google_scraper.js
@@ -37,14 +37,15 @@ 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;
optResults = optResults || 10;
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;

0 comments on commit ab71706

Please sign in to comment.