2022-05-24 11:51:53 +10:00
|
|
|
// Copyright 2020-22 PJ Engineering and Business Solutions Pty. Ltd. All rights reserved.
|
2021-03-23 13:46:11 +11:00
|
|
|
|
2021-01-13 16:43:19 +11:00
|
|
|
package googlesearch
|
|
|
|
|
2021-01-13 16:57:47 +11:00
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
|
|
|
|
"golang.org/x/time/rate"
|
|
|
|
)
|
|
|
|
|
|
|
|
// ErrBlocked indicates that Google has detected that you were scraping and temporarily blocked you.
|
|
|
|
// The duration of the block is unspecified.
|
|
|
|
//
|
|
|
|
// See: https://github.com/rocketlaunchr/google-search#warning-warning
|
|
|
|
var ErrBlocked = errors.New("google block")
|
2021-01-13 16:43:19 +11:00
|
|
|
|
|
|
|
// RateLimit sets a global limit to how many requests to Google Search can be made in a given time interval.
|
|
|
|
// The default is unlimited (but obviously Google Search will block you temporarily if you do too many
|
|
|
|
// calls too quickly).
|
|
|
|
//
|
|
|
|
// See: https://godoc.org/golang.org/x/time/rate#NewLimiter
|
|
|
|
var RateLimit = rate.NewLimiter(rate.Inf, 0)
|