DDG::ZeroClickInfo::Fathead - DuckDuckGo server side used ZeroClickInfo Fathead result class
version 1018
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', );
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.
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.
This is the type of result.
A for article (regular ZCI box) R for redirect D for disambiguation
Only for type 'R' (redirect)
This is the title it should be directed to.
e.g. "Duck Duck Go" -> "DuckDuckGo"
Ignore.
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.
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]]
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
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
You can reference an external image that we will download and reformat for display. You would do:
[[Image:$url]]
This is the text in the ZCI box that should concisely explain the topic.
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.
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.
DuckDuckGo <open@duckduckgo.com>
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
To install DDG, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DDG
CPAN shell
perl -MCPAN -e shell install DDG
For more information on module installation, please visit the detailed CPAN module installation guide.