WWW::DuckDuckGo::ZeroClickInfo - A DuckDuckGo Zero Click Info definition
version 0.007
use WWW::DuckDuckGo; my $zci = WWW::DuckDuckGo->new->zci('duck duck go'); print "Heading: ".$zci->heading if $zci->has_heading; print "The answer is: ".$zci->answer if $zci->has_answer; if ($zci->has_default_related_topics) { for (@{$zci->default_related_topics}) { print $_->url."\n"; } } if (!$zci->has_default_related_topics and %{$zci->related_topics_sections}) { print "Disambiguatious Related Topics:\n"; for (keys %{$zci->related_topics_sections}) { print " Related Topics Groupname: ".$_."\n"; for (@{$zci->related_topics_sections->{$_}}) { print " - ".$_->first_url->as_string."\n" if $_->has_first_url; } } } }
This package reflects the result of a zeroclickinfo API request.
Gives back a URI::http
Gives back a hash reference of related topics with its Name as key and as value an array reference of WWW::DuckDuckGo::Link objects. If there is a specific topic, a so called default topic, which is the case in all non disambigious search results, then this topic has the name "_", but you can access it with the method default_related_topics directly.
Gives back an array reference of WWW::DuckDuckGo::Link objects. Can be undef, check with has_default_related_topics.
Gives back an array reference of WWW::DuckDuckGo::Link objects. Can be undef, check with has_results.
Gives back a longer version of the type.
IRC
Join #duckduckgo on irc.freenode.net. Highlight Getty for fast reaction :).
Repository
http://github.com/Getty/p5-www-duckduckgo Pull request and additional contributors are welcome
Issue Tracker
http://github.com/Getty/p5-www-duckduckgo/issues
Torsten Raudssus <torsten@raudssus.de>
Michael Smith <crazedpsyc@duckduckgo.com>
This software is copyright (c) 2011 by Raudssus Social Software.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install WWW::DuckDuckGo, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::DuckDuckGo
CPAN shell
perl -MCPAN -e shell install WWW::DuckDuckGo
For more information on module installation, please visit the detailed CPAN module installation guide.