我一直在使用DuckDuckGo的Go 库,除了一件事外,它一直运行良好。在“相关主题”部分。通常,它看起来像这样:{"RelatedTopics" : [ { "Result" : "<a href=\"http://duckduckgo.com/Criticism_of_Google\">Criticism of Google</a> - Criticism of Google includes possible misuse and manipulation of search results, its use of others' intellectual property, concerns that its compilation of data may violate people's privacy, cen...", "Icon" : { "URL" : "", "Height" : "", "Width" : "" }, "FirstURL" : "http://duckduckgo.com/Criticism_of_Google", "Text" : "Criticism of Google - Criticism of Google includes possible misuse and manipulation of search results, its use of others' intellectual property, concerns that its compilation of data may violate people's privacy, cen..." }, { "Result" : "<a href=\"http://duckduckgo.com/PRISM_(surveillance_program)\">PRISM</a> - PRISM is a clandestine mass electronic surveillance data mining program known to have been operated by the United States National Security Agency (NSA) since 2007.", "Icon" : { "URL" : "", "Height" : "", "Width" : "" }, "FirstURL" : "http://duckduckgo.com/PRISM_(surveillance_program)", "Text" : "PRISM - PRISM is a clandestine mass electronic surveillance data mining program known to have been operated by the United States National Security Agency (NSA) since 2007." },但是,有时在“RealtedTopics”部分中,会出现一系列“Topics”,其中包含许多“Results”和该 Topic 的“Name”。
1 回答
慕无忌1623718
TA贡献1744条经验 获得超4个赞
主题似乎包含一个切片Topics []Topic:
type Icon struct {
URL string
Height string
Width string
}
type Topic struct {
Result string
Icon Icon
FirstURL string
Text string
Topics []Topic `json:",omitempty"`
}
type RootObj struct {
RelatedTopics []Topic
}
- 1 回答
- 0 关注
- 203 浏览
添加回答
举报
0/150
提交
取消