Terminus-Project / Terminus-Bot

A scriptable IRC bot written in Ruby.
http://terminus-bot.net/
Other
38 stars 18 forks source link

DuckDuckGo Search Command #51

Closed aji closed 11 years ago

aji commented 11 years ago

A command to search using the DuckDuckGo search engine (;ddg) has been requested.

aji commented 11 years ago

I was informed of the following via IRC: < +shmibs > if you can make an http request, all you have to do is request http://duckduckgo.com/?q=!ducky+<search+term>, and it will redirect you to the first result

Could be useful for implementing the script, since it appears the JSON API is restricted to instant results, although that is still a lot of cool features. Perhaps ;ddg and ;ddgi commands?

kabaka commented 11 years ago

@aji The JSON API includes that "bang" functionality. For example: http://api.duckduckgo.com/?q=!ducky+cats&format=json&pretty=1&no_redirect=1 (redirect can be enabled by setting the last thing to 0 or removing it).