Type-safe dork queries for search engines such as Google, Yahoo, DuckDuckGo & Bing
Go to file
sundowndev ecf6a7262a feat: implement intitle method 2020-02-27 19:47:17 +01:00
.github/workflows ci: setup coverage (#1) 2020-02-26 12:21:22 +01:00
.codeclimate.yml chore: codeclimate config 2020-02-24 21:22:55 +01:00
.gitignore chore: create .gitignore 2020-02-24 21:57:39 +01:00
LICENSE chore: create license 2020-02-24 20:34:46 +01:00
README.md fix(docs): URL conversion in examples 2020-02-27 14:11:55 +01:00
doc.go feat: implement intitle method 2020-02-27 19:47:17 +01:00
dorkgen.go feat: implement intitle method 2020-02-27 19:47:17 +01:00
go.mod feat: init package 2020-02-24 20:21:12 +01:00
go.sum feat: init package 2020-02-24 20:21:12 +01:00
google.go feat: implement intitle method 2020-02-27 19:47:17 +01:00
google_test.go feat: implement intitle method 2020-02-27 19:47:17 +01:00

README.md

Dorkgen

Dorkgen is a dork request generator for popular search engines such as Google, DuckDuckGo and Bing. Learn more about Google Hacking.

Install

go get github.com/sundowndev/dorkgen

Usage

Try it in the Go playground

Get started

package main

import "github.com/sundowndev/dorkgen"

func main() {
  dork := &dorkgen.GoogleSearch{}
  // dork := &dorkgen.DuckDuckGo{}
  // dork := &dorkgen.Bing{}

  dork.Site("example.com").Intext("text").ToString()
  // returns: site:example.com "text"
}

Operators

dork.Site("facebook.com").Or().Site("twitter.com").ToString()
// returns: site:facebook.com OR site:twitter.com

dork.Intext("facebook").And().Intext("twitter").ToString()
// returns: "facebook" AND "twitter"

Exclude results

dork.
  Exclude((&dorkgen.GoogleSearch{}).
    Site("example.com").
    ToString()).
  Site("example.*").
  Or().
  Intext("text")
// returns: -site:example.com site:example.* OR "text"

Group tags along with operators

  dork.
    Group((&dorkgen.GoogleSearch{}).
      Site("facebook.com").
      Or().
      Site("twitter.com").
      ToString()).
    Intext("wtf").
    ToString()
  // returns: (site:facebook.com OR site:twitter.com) "wtf"
}

URL conversion

dork.
  Site("facebook.*").
  Exclude((&dorkgen.GoogleSearch{}).
    Site("facebook.com").
    ToString())

dork.ToString()
// returns: site:facebook.* -site:facebook.com
dork.ToURL()
// returns: https://www.google.com/search?q=site%3Afacebook.%2A+-site%3Afacebook.com