dorkali

package module
v0.0.0-...-0a727c4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2022 License: MIT Imports: 2 Imported by: 0

README

dorkali

Dorkali a program written in golang to search query in search engines.

Installing

Install script by:

GO111MODULE=off go get -u github.com/aWolver/dorkali/cmd/...

Script will install in $GOPATH/bin

Or use git:

git clone https://github.com/aWolver/dorkali
cd dorkali
go build ./cmd/dorkali/...

Using

Call dorkali to see help message:

$ dorkali
Dorkali a program written in golang to dorks queries in search engines

Usage:
	./dorkali [list | version [engineName] | help [engineName]]
	./dorkali engineName [OPTIONS]

*Commands:
	version [engineName]   print version, or engine version if pass engineName, and exit
	list                   print list of engines and exit
	help [engineName]      print this help, or print engine help if pass engineName, and exit

Then you can use list command to see engines:

$ dorkali list
Registered engines:
  ...

You can see help of engine you want with dorkali help engineName, here for example google:

$ dorkali help google

Example

┌─[awolver]─[~]
└──╼ $ dorkali google -n 2 "my ip"
https://whatismyipaddress.com/learning/ip-addresses
https://www.whatismyip.com/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Engines

func Engines() []string

Engines returns registered engines names

func RegisterEngine

func RegisterEngine(name string, new_engine func() Engine)

register engine

Types

type API

type API struct {
	// contains filtered or unexported fields
}

func Use

func Use(engineName string) (*API, error)

Use(...) returns engine if registered

returns error if not found

returns error if engine.Start() returns error

func UseWithoutStart

func UseWithoutStart(engineName string) (*API, error)

UseWithoutStart(...) like Use(...) but not call Start()

returns error if not found

func (*API) Name

func (a *API) Name() string

func (*API) ParseHTML

func (a *API) ParseHTML(h string) ([]Result, error)

ParseHTML parses html responsed from google

func (*API) ParseResponse

func (a *API) ParseResponse(response *http.Response) ([]Result, error)

ParseResponse parses returned response from .SearchContext(...) or .Search(...) methods

func (*API) Search

func (a *API) Search(query interface{}) (*http.Response, error)

Search searchs query and returns response

func (*API) Start

func (a *API) Start() error

func (API) String

func (a API) String() string

String returns string ( format: "API( name version | description )" )

func (*API) Usage

func (a *API) Usage()

func (*API) Version

func (a *API) Version() string

Version returns engine version

type Engine

type Engine interface {
	// Use(...) call it when want to use it
	Start() error

	// Version returns engine version
	Version() string

	// Description of engine
	Description() string

	// Usage prints usage of engine
	Usage()

	// SearchContext searchs query and returns response
	Search(query interface{}) (*http.Response, error)

	// ParseResponse parses returned response from .Search(...) method
	ParseResponse(response *http.Response) ([]Result, error)

	// ParseHTML parses html responsed from google
	ParseHTML(h string) ([]Result, error)
}

type Result

type Result interface {
	// Title returns title of result
	Title() string

	// Description returns description of result
	Description() string

	// Url returns url of result
	Url() string

	// String returns result as string
	String() string
}

Directories

Path Synopsis
cmd
GOLANG HTML Parser
GOLANG HTML Parser

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL