googleit

package module
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2019 License: MIT Imports: 11 Imported by: 2

README

googleit

Code coverage Build Status Go Doc

Install

go get github.com/schollz/googleit

Usage

urls, _ := googleit.Search("cats wiki")
fmt.Println(urls[0])
// https://en.wikipedia.org/wiki/Cat

Contributing

Pull requests are welcome. Feel free to...

  • Revise documentation
  • Add new features
  • Fix bugs
  • Suggest improvements

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bing

func Bing(query string, ops ...Options) (urls []string, err error)

func DuckDuckGo

func DuckDuckGo(query string, ops ...Options) (urls []string, err error)

func ListToSet

func ListToSet(s []string) (t []string)

ListToSet convers a list to a set (removing duplicates) but preserving order

func Search(query string, ops ...Options) (urls []string, err error)

func StartPage added in v1.5.0

func StartPage(query string, ops ...Options) (urls []string, err error)

Types

type HTTPClient added in v1.5.0

type HTTPClient struct {
	Client *http.Client
	// contains filtered or unexported fields
}

func GetClient added in v1.5.0

func GetClient(useTor bool) (httpClient *HTTPClient, err error)

func (*HTTPClient) Close added in v1.5.0

func (h *HTTPClient) Close() (err error)

func (*HTTPClient) Get added in v1.5.0

func (h *HTTPClient) Get(url string) (resp *http.Response, err error)

type Options added in v1.5.0

type Options struct {
	Site        string
	NumPages    int
	UseTor      bool
	MustInclude []string
}

type Result added in v1.5.0

type Result struct {
	Title string
	URL   string
}

Jump to

Keyboard shortcuts

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