News for hackers. Stuff that matters.
Re:Show HN: Ddgr – search DuckDuckGo from your terminal by dontbenebby on Monday April 08, 2019 @08:57PM (#19610657)
Is there a way to supress the search results if I only want an instant answer?

(Ex: If I type in "ip" merely return my IP, not a long list of whois DBs)

Re:Show HN: Ddgr – search DuckDuckGo from your terminal by dredmorbius on Monday April 08, 2019 @09:02PM (#19610687)
Instant results are supported:

https://github.com/jarun/ddgr

There are a number of "instant" bangs, though it's not clear if these deliver what you want: https://duckduckgo.com/bang?q=instant

You can incorporate bang int commandlinee search, though bangs ("!") generally require quoting to avoid bash / shell interpretation.

Re:Show HN: Ddgr – search DuckDuckGo from your terminal by dontbenebby on Monday April 08, 2019 @10:22PM (#19611172)
Ah cool, thanks. Very useful!

I meant more like the various cheatsheets.

(Ex: https://duckduckgo.com/?q=vim+cheat+sheet)

That query would pull up search results, but not the cheat sheet itself. Or if I do "roll 3 dice" I get unicode dice, but not the numerical sum like on the web version.

Anyways, this is really a minor gripe - this is a really cool tool and I appreciate the time you've put into it.

I can see myself using it a lot in the future! :)

Re:Show HN: Ddgr – search DuckDuckGo from your terminal by apjana on Monday April 08, 2019 @10:13PM (#19611104)
Try

  ddgr ip --np
Re:Show HN: Ddgr – search DuckDuckGo from your terminal by dontbenebby on Monday April 08, 2019 @10:27PM (#19611196)
Thanks! Looks like

ddgr -n 1 --np ip

gets close

(setting -n to 0 gives a lot of results for some reason?)

Anyways, very small gripe - really like this program. Thanks for your efforts!

Re:Show HN: Ddgr – search DuckDuckGo from your terminal by apjana on Monday April 08, 2019 @10:34PM (#19611241)
n=0 is the default and results in the default behavior - sow all fetched results in the same page.

Thanks for the compliment! Glad to know you like it.

Update: In fact, there was an option and an extra API to fetch only the instant answer. But it seemed like a overkill because the instant answer comes along with the other results. So I removed that additional API a while back.