Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Type-safe dork queries for search engines such as Google, Yahoo, DuckDuckGo & Bing

License

NotificationsYou must be signed in to change notification settings

sundowndev/dorkgen

Repository files navigation

Go Referencebuild statusgo reportLatest version

Dorkgen

Dorkgen is a dork query wrapper for popular search engines such as Google Search, DuckDuckGo, Yahoo and Bing.Learn more about Google Hacking. The goal of this package is to provide simple interfaces to creates valid dork queries for various search engines. This library was initially created forPhoneInfoga.

Current status

Version 1 is ongoing, but the API is still not fixed.See below table for supported search engines and status of their implementation.

Search engineImplementation status
Google SearchStable
DuckDuckGoStable
Yahoo SearchWIP
Bing SearchWIP

Install

Fetch the module :

go get github.com/sundowndev/dorkgen

Usage

Try it in the Go playground

Get started

package mainimport"github.com/sundowndev/dorkgen"funcmain() {dork:=dorkgen.NewGoogleSearch()// dork := dorkgen.NewDuckDuckGo()// dork := dorkgen.NewBingSearch()// dork := dorkgen.NewYahooSearch()dork.Site("example.com").InText("text").String()// returns: site:example.com intext:"text"}

Operators

funcmain() {dork.Site("facebook.com").Or().Site("twitter.com").String()// returns: site:facebook.com | site:twitter.comdork.InText("facebook").And().InText("twitter").String()// returns: intext:"facebook" + intext:"twitter"}

Exclude results

funcmain() {dork.Exclude(dorkgen.NewGoogleSearch().Site("example.com")).Site("example.*").Or().InText("text")// returns: -site:example.com site:example.* | "text"}

Group tags along with operators

funcmain() {dork.Group(dorkgen.NewGoogleSearch().Site("facebook.com").Or().Site("twitter.com")).InText("wtf").String()// returns: (site:facebook.com | site:twitter.com) "wtf"}

URL conversion

funcmain() {dork.Site("facebook.*").Exclude(dorkgen.NewGoogleSearch().Site("facebook.com"))dork.String()// returns: site:facebook.* -site:facebook.comdork.ToURL()// returns: https://www.google.com/search?q=site%3Afacebook.%2A+-site%3Afacebook.com}

Support

Thanks toJetBrains for supporting my open-source projects.


[8]ページ先頭

©2009-2025 Movatter.jp