Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Latest commit

 

History

History
27 lines (20 loc) · 489 Bytes

README.md

File metadata and controls

27 lines (20 loc) · 489 Bytes

ddg - A Go package for DuckDuckGo Zero-click API access

Install

go get github.com/whee/ddg

Use

package main

import (
	"fmt"
	"github.com/whee/ddg"
	"os"
)

func main() {
	for _, s := range os.Args[1:] {
		if r, err := ddg.ZeroClick(s); err == nil {
			fmt.Printf("%s: %s\n", s, r.Abstract)
		} else {
			fmt.Printf("Error looking up %s: %v\n", s, err)
		}
	}
}

See godoc documentation for more information.