DuckDuckGoプライバシー重視なオープンソース検索エンジンです。
Emacs Wikiなんかでは標準の検索エンジンになっていますね。
利用ユーザの情報を保存しないため、高い安全性を誇ります。
原理上はAさんとBさんが同じ検索ワードで検索をかけても同じ結果がでます。*1
ruby gem
さて、この素晴しい検索エンジンをRubyで使う方法が用意されています。
$ gem install duck-duck-go
試しに、「Rubyのパパ」こと、まつもゆきひろ氏を調べてみます。
require 'duck_duck_go' result = DuckDuckGo.new.zeroclickinfo("Yukihiro Matsumoto") => #<DuckDuckGo::ZeroClickInfo:0x007f88258c3ef8 @abstract= "Yukihiro Matsumoto is a Japanese computer scientist and software programmer best known as the chief designer of the Ruby programming language and its reference implementation, Matz's Ruby Interpreter. His demeanor has brought about a motto in the Ruby community \"Matz is nice and so we are nice,\" commonly abbreviated as MINASWAN.", ...
検索結果を確認するには以下のようにします
result.heading => "Yukihiro Matsumoto" result.abstract_text => "Yukihiro Matsumoto is a Japanese computer scientist and software programmer best known as the chief designer of the Ruby programming language and its reference implementation, Matz's Ruby Interpreter. His demeanor has brought about a motto in the Ruby community \"Matz is nice and so we are nice,\" commonly abbreviated as MINASWAN."
*1:実際にはアップデートやら何やらで多少ズレるでしょうが