Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A Ruby library to access the DuckDuckGo Zero Click Info API

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 CHANGES
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION
Octocat-spinner-32 duck-duck-go.gemspec
README.rdoc

This is a Ruby library to access the DuckDuckGo Zero Click Info API.

How to install

gem install duck-duck-go

Synopsis

require "duck_duck_go"

ddg = DuckDuckGo.new
zci = ddg.zeroclickinfo("Stephen Fry") # ZeroClickInfo object

zci.heading # Stephen Fry
zci.abstract_text # Stephen John Fry is an English actor, screenwriter, author, playwright, ...
zci.related_topics["_"][0].text # Stephen Fry (cricketer) ...

Description

This library accesses the DuckDuckGo Zero Click Info API, and returns an DuckDuckGo::ZeroClickInfo object containing the result.

Depending on the result type, the related_topics hash will contain slightly different results.

For most queries, related_topics["_"] contains an array of the related topics.

For a disambiguation query, related_topics["_"] contains the related topics, where as related_topics["Topic"] contains the disambiguation results. For example, searching for apple, you will find a related_topics["Compaines"] entry containing Apple Inc and Apple Corp, amongst others.

Issues

github.com/andrewrjones/ruby-duck-duck-go/issues

Source code

github.com/andrewrjones/ruby-duck-duck-go

Credits

API and design heavily influenced by WWW::DuckDuckGo, the equivalent Perl module.

Copyright and License

Copyright © 2011 Andrew Jones (andrew-jones.com)

This code is available under the MIT License. See the LICENSE file for more details.

Something went wrong with that request. Please try again.