chore: readme

Usage & API
pull/3/head
Raphaël 2020-02-25 10:03:38 +01:00 committed by GitHub
parent 9acc7a9321
commit 182a2135a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 20 deletions

View File

@ -31,25 +31,21 @@ go get github.com/sundowndev/dorkgen
```go
package main
import (
"fmt"
"github.com/sundowndev/dorkgen"
)
import "github.com/sundowndev/dorkgen"
func main() {
dork := &dorkgen.Google{}
dork := &dorkgen.GoogleSearch{}
// dork := &dorkgen.DuckDuckGo{}
// dork := &dorkgen.Bing{}
dork.Site("example.com").Intext("06792489265").ToString()
// site:example.com "06792489265"
// returns: site:example.com "06792489265"
dork.Site("example.com").Or().Intext("06792489265").ToString()
// site:example.com OR "06792489265"
// returns: site:example.com OR "06792489265"
dork.Site("facebook.*").Exclude("site:facebook.com").ToUrl()
// https://www.google.com/search?q=site%3A"facebook.*"+-site%3Afacebook.com
dork.Site("facebook.*").Exclude("site:facebook.com").ToURL()
// returns: https://www.google.com/search?q=site%3A"facebook.*"+-site%3Afacebook.com
}
```
@ -57,15 +53,15 @@ func main() {
```go
type EngineFactory interface {
Site(string) *GoogleSearch
ToString() string
ToUrl() string
Intext(string) *GoogleSearch
Inurl(string) *GoogleSearch
Filetype(string) *GoogleSearch
Cache(string) *GoogleSearch
Related(string) *GoogleSearch
Ext(string) *GoogleSearch
Exclude(string) *GoogleSearch
Site(string) *GoogleSearch
ToString() string
ToURL() string
Intext(string) *GoogleSearch
Inurl(string) *GoogleSearch
Filetype(string) *GoogleSearch
Cache(string) *GoogleSearch
Related(string) *GoogleSearch
Ext(string) *GoogleSearch
Exclude(string) *GoogleSearch
}
```