diff --git a/google.go b/google.go index 1979a5b..eab39f6 100644 --- a/google.go +++ b/google.go @@ -108,8 +108,8 @@ func (e *GoogleSearch) Ext(ext string) *GoogleSearch { } // Exclude excludes some results. -func (e *GoogleSearch) Exclude(value string) *GoogleSearch { - e.tags = append(e.tags, e.concat(excludeTag, value, false)) +func (e *GoogleSearch) Exclude(tags *GoogleSearch) *GoogleSearch { + e.tags = append(e.tags, e.concat(excludeTag, tags.String(), false)) return e } @@ -124,3 +124,9 @@ func (e *GoogleSearch) Intitle(value string) *GoogleSearch { e.tags = append(e.tags, e.concat(intitleTag, value, true)) return e } + +// Plain allows you to add additional values as string without any kind of formatting. +func (e *GoogleSearch) Plain(value string) *GoogleSearch { + e.tags = append(e.tags, value) + return e +} diff --git a/google_test.go b/google_test.go index ce73d39..e902c61 100644 --- a/google_test.go +++ b/google_test.go @@ -105,10 +105,10 @@ func TestInit(t *testing.T) { dork = NewGoogleSearch() result := dork. - Exclude("html"). - Exclude("htm"). - Exclude("php"). - Exclude("md5sums"). + Exclude(NewGoogleSearch().Plain("html")). + Exclude(NewGoogleSearch().Plain("htm")). + Exclude(NewGoogleSearch().Plain("php")). + Exclude(NewGoogleSearch().Plain("md5sums")). String() assert.Equal(result, "-html -htm -php -md5sums", "they should be equal")