dorkali

package module
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2022 License: MIT Imports: 2 Imported by: 0

README

Dorkali

A mini and simple tool to search in search engines written in golang.

  • Supported engines:
    • Google

Installation

GO111MODULE=off go get github.com/awolverp/dorkali/cmd/dorkali/

Or

git clone https://github.com/awolverp/dorkali/ && cd dorkali && go install ./cmd/dorkali/

Usage

Use dorkali help to see usage:

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

For example if you want to see google engine help, you use dorkali help google command. you will see that:

Usage: dorkali google [OPTIONS] QUERY

*Output Options:
        ...

*Request Options:
        ...

*Search Options:
        ...

*Query Helpers:
        ...

Example

$ dorkali google -n 5 "github"

https://desktop.github.com/
https://github.blog/2022-11-10-introducing-github-actions-importer/
http://en.wikipedia.org/wiki/C_(programming_language)
https://github.blog/
https://play.google.com/store/apps/details?id=com.github.android&hl=en&gl=US

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