Permalink
Browse files

Merge pull request #3 from lucasvall/patch-1

Addition of '&filter=0' in search query
  • Loading branch information...
2 parents 26e195b + ab71706 commit 92587da39890016ee62c05c6edf00c917f4ebf22 @chrisle committed Feb 2, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 google_scraper.js
View
@@ -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 92587da

Please sign in to comment.