go get github.com/whee/ddg
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.