ddgquery

package module
v0.0.0-...-ab8ec8e Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2017 License: BSD-3-Clause Imports: 5 Imported by: 1

README

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Qresult

type Qresult struct {
	Title string
	Info  string
	Ref   string
}

A Qresult holds the returned query data

func Query

func Query(q string, it int) ([]Qresult, string)

Requests the query and puts the results into an array

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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