Documentation ¶
Overview ¶
Package goduckgo provides the functionality for using DuckDuckGo API. For the description of the API, visit http://duckduckgo.com/api.html.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Icon ¶
type Icon struct { URL string Height interface{} // can be string or number ("16" or 16) Width interface{} // can be string or number ("16" or 16) }
Icon associated with related topics
URL: URL of icon Height: height of icon (px) Width: width of icon (px)
type Message ¶
type Message struct { Definition string DefinitionSource string Heading string AbstractText string Abstract string AbstractSource string Image string Type string AnswerType string Redirect string DefinitionURL string Answer string AbstractURL string Results Results RelatedTopics RelatedTopics }
Message is a structure containing all the information returned by DDG for a query.
Abstract: topic summary (can contain HTML, e.g. italics) AbstractText: topic summary (with no HTML) AbstractSource: name of Abstract source AbstractURL: deep link to expanded topic page in AbstractSource Image: link to image that goes with Abstract Heading: name of topic that goes with Abstract Answer: instant answer AnswerType: type of Answer, e.g. calc, color, digest, info, ip, iploc, phone, pw, rand, regexp, unicode, upc, or zip (see goodies & tech pages for examples). Definition: dictionary definition (may differ from Abstract) DefinitionSource: name of Definition source DefinitionURL: deep link to expanded definition page in DefinitionSource RelatedTopics: array of internal links to related topics associated with Abstract Results: array of external links associated with Abstract Type: response category, i.e. A (article), D (disambiguation), C (category), N (name), E (exclusive), or nothing. Redirect: !bang redirect URL
type RelatedTopic ¶
RelatedTopic is a internal link to related topics associated with Abstract
Result: HTML link to a related topic FirstURL: first URL in Result Icon: icon associated with related topic Text: text from first URL
func (*RelatedTopic) Show ¶
func (topic *RelatedTopic) Show(prefix string)
Show RelatedTopic as standard output
type RelatedTopics ¶
type RelatedTopics []RelatedTopic
type Result ¶
type Result RelatedTopic
Result is an external link associated with Abstract
Result: HTML link(s) to external site(s) FirstURL: first URL in Result Icon: icon associated with FirstURL Text: text from FirstURL
Click to show internal directories.
Click to hide internal directories.