NAME

DDG::ZeroClickInfo::Fathead - DuckDuckGo server side used ZeroClickInfo Fathead result class

VERSION

version 1018

SYNOPSIS

my $zci_fathead = DDG::ZeroClickInfo::Fathead->new(
    title => 'Widget',
    type => 'A',
    categories => 'Products',
    abstract => 'The widget is the staple of any good business.',
    source_url => 'http://widg.et/amazingwidget.jpg',
);

DESCRIPTION

This is the extension of the WWW::DuckDuckGo::ZeroClickInfo class, how it is used on the server side of DuckDuckGo. It adds attributes to the ZeroClickInfo class which are not required for the "output" part of it.

ATTRIBUTES

title

This is the title of the result. This is what the user must search, with the possible addition of specific trigger words, to trigger this result.

type

This is the type of result.

A for article (regular ZCI box) R for redirect D for disambiguation

redirect

Only for type 'R' (redirect)

This is the title it should be directed to.

e.g. "Duck Duck Go" -> "DuckDuckGo"

other_uses

Ignore.

categories

You can put the article in multiple categories, and category pages will be created automatically.

e.g.: http://duckduckgo.com/c/Procedural_programming_languages

You would do: Procedural programming languages\\n

You can have several categories, separated by an escaped newline. Categories should generally end with a plural noun.

references

Ignore.

see_also

You can reference related topics here, which get turned into links in the Zero-click Info box. On the perl example, e.g. Perl Data Language, you would do:

[[Perl Data Language]]

If the link name is different, you could do:

[[Perl Data Language|PDL]]

further_reading

Ignore.

You can add external links that get put first when this article comes out. The canonical example is an official site, which looks like:

[$url Official site]\\n

You can have several, separated by an escaped newline, though only a few will be used. You can also have before and after text or put multiple links in one like this:

Before text [$url link text] after text [$url2 second link].\\n

disambiguation

Only for type 'D' (disambiguation)

This is for searches that may benefit from one of many results, but the search isn't specific enough to tell which the user is looking for. Disambiguations are a list of links to more specific searches. The format looks like this:

Search: "example"

*[[this example]], a brief summary\\n*[[that example]], another summary

image

You can reference an external image that we will download and reformat for display. You would do:

[[Image:$url]]

abstract

This is the text in the ZCI box that should concisely explain the topic.

source_url

This is the full URL for the source. If all the URLs are relative to the main domain, this can be relative to that domain.

METHODS

new_via_output

Takes a line from output.txt, constructs a hash with the input array mapped to the attributes of this package, and returns a new DDG::ZeroClickInfo::Fathead object instantiated with that hash.

AUTHOR

DuckDuckGo <open@duckduckgo.com>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2013 by DuckDuckGo, Inc. https://duckduckgo.com/.

This is free software, licensed under:

The Apache License, Version 2.0, January 2004