1WWW::DuckDuckGo::ZeroClUiscekrInCfoon(t3r)ibuted Perl DoWcWuWm:e:nDtuactkiDounckGo::ZeroClickInfo(3)
2
3
4
6 WWW::DuckDuckGo::ZeroClickInfo - A DuckDuckGo Zero Click Info
7 definition
8
10 version 0.016
11
13 use WWW::DuckDuckGo;
14
15 my $zci = WWW::DuckDuckGo->new->zci('duck duck go');
16
17 print "Heading: ".$zci->heading if $zci->has_heading;
18
19 print "The answer is: ".$zci->answer if $zci->has_answer;
20
21 if ($zci->has_default_related_topics) {
22 for (@{$zci->default_related_topics}) {
23 print $_->url."\n";
24 }
25 }
26
27 if (!$zci->has_default_related_topics and %{$zci->related_topics_sections}) {
28 print "Disambiguatious Related Topics:\n";
29 for (keys %{$zci->related_topics_sections}) {
30 print " Related Topics Groupname: ".$_."\n";
31 for (@{$zci->related_topics_sections->{$_}}) {
32 print " - ".$_->first_url->as_string."\n" if $_->has_first_url;
33 }
34 }
35 }
36 }
37
39 This package reflects the result of a zeroclickinfo API request.
40
42 has_abstract
43 abstract
44 has_abstract_text
45 abstract_text
46 has_abstract_source
47 abstract_source
48 has_abstract_url
49 abstract_url
50 Gives back a URI::http
51
52 has_image
53 image
54 Gives back a URI::http
55
56 has_heading
57 heading
58 has_answer
59 answer
60 has_answer_type
61 answer_type
62 has_definition
63 definition
64 has_definition_source
65 definition_source
66 has_definition_url
67 definition_url
68 has_html
69 html
70 Gives back a URI::http
71
72 has_related_topics_sections
73 related_topics_sections
74 Gives back a hash reference of related topics with its Name as key and
75 as value an array reference of WWW::DuckDuckGo::Link objects. If there
76 is a specific topic, a so called default topic, which is the case in
77 all non disambigious search results, then this topic has the name "_",
78 but you can access it with the method default_related_topics directly.
79
80 default_related_topics
81 Gives back an array reference of WWW::DuckDuckGo::Link objects. Can be
82 undef, check with has_default_related_topics.
83
84 has_results
85 results
86 Gives back an array reference of WWW::DuckDuckGo::Link objects. Can be
87 undef, check with has_results.
88
89 has_type
90 type
91 type_long
92 Gives back a longer version of the type.
93
94 has_redirect
95 redirect
96 Access the URL it would redirect you to (for !bangs)
97
100 IRC
101
102 Join #duckduckgo on irc.freenode.net. Highlight Getty for fast reaction :).
103
104 Repository
105
106 http://github.com/Getty/p5-www-duckduckgo
107 Pull request and additional contributors are welcome
108
109 Issue Tracker
110
111 http://github.com/Getty/p5-www-duckduckgo/issues
112
114 • Torsten Raudssus <torsten@raudss.us> <https://raudss.us/>
115
116 • Michael Smith <crazedpsyc@duckduckgo.com>
117
119 This software is copyright (c) 2013 by DuckDuckGo, Inc.
120 <https://duckduckgo.com/>.
121
122 This is free software; you can redistribute it and/or modify it under
123 the same terms as the Perl 5 programming language system itself.
124
125
126
127perl v5.32.1 2021-01-27 WWW::DuckDuckGo::ZeroClickInfo(3)