Skip to content

Latest commit

 

History

History
executable file
·
39 lines (26 loc) · 1.05 KB

README.md

File metadata and controls

executable file
·
39 lines (26 loc) · 1.05 KB

DuckDuckGo Query Library

pipeline status coverage report

ddgquery provides a method to retrieve basic search results from DuckDuckGo. It leverages goquery and its very robust feature set to query DuckDuckGo.

Installation

$ go get https://gitlab.com/psheets/ddgquery

Example

package main

import (
	"fmt"
	"gitlab.com/psheets/ddgquery"
)

func main() {

	// Provide query the search term and how many results you want
	// query returns an array of results and the query URL
	results, query := ddgquery.Query("test", 3)

	fmt.Println(query)

	for _, r := range results {
		fmt.Printf("\nTitle: %s \nInfo: %s \nRef: %s \n\n", r.Title, r.Info, r.Ref)
	}
}

License

The BSD 3-Clause license