NAME

WWW::DuckDuckGo::ZeroClickInfo - A DuckDuckGo Zero Click Info definition

VERSION

version 0.014

SYNOPSIS

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;
      }
    }
  }
}

DESCRIPTION

This package reflects the result of a zeroclickinfo API request.

METHODS

has_abstract

abstract

has_abstract_text

abstract_text

has_abstract_source

abstract_source

has_abstract_url

abstract_url

Gives back a URI::http

has_image

image

Gives back a URI::http

has_heading

heading

has_answer

answer

has_answer_type

answer_type

has_definition

definition

has_definition_source

definition_source

has_definition_url

definition_url

has_html

html

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.

has_results

results

Gives back an array reference of WWW::DuckDuckGo::Link objects. Can be undef, check with has_results.

has_type

type

type_long

Gives back a longer version of the type.

has_redirect

redirect

Access the URL it would redirect you to (for !bangs)

METHODS

SUPPORT

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

AUTHORS

  • Torsten Raudssus <torsten@raudssus.de>

  • Michael Smith <crazedpsyc@duckduckgo.com>

COPYRIGHT AND LICENSE

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.