93 comments

[ 7.5 ms ] story [ 184 ms ] thread
I would love this as an actual command or even a telnet/ssh server!
Get surfraw and use Links as the browser.
Very cool. Now please let me access it over SSH.
Looks amazing, but does any search > 3 characters fail for anyone else?
From what I could garner it uses the public DuckDuckGo Instant Answers API[0], which only returns results for specific queries (try "Microsoft", then try something obscure). This is most likely causing your issue.

[0]: https://duckduckgo.com/api

Sounds more like they're using mysql default settings, search is 3 characters minimum, below that it fails.
Oh, I should've noticed based on how specific the results were. Thanks!
at least `ls` works!
It's weird that the TTY shows you search results but selecting a link takes you back to the DDG search page to search for the selected result again?
For people that are looking for a nice search TUI, may I point you to Googler. It's made by the author of NNN and a couple other fantastic terminal tools. Highly recommend. It's amazing how clean you can make the interface

https://github.com/jarun/googler

Screenshot of Googler in action when it's nice and clean

https://snid.es/2021OCT/YG4OXAlXg4INZWPe.png

It looks like it doesnt respect $LINES (or something similar). On first try, the top 2 results scrolled off the screen.
It's a CLI, not a TUI. I put quite a bit of thought into that decision, and whether to integrate a pager. See [1]. The workarounds are (1) limit the number of results per page with -n <num>; (2) use the -r, --reverse option to show the top results last.

[1] https://github.com/jarun/googler/issues/281

It would be nice if there was a way to run a terminal command without auto-scrolling. So often I run something that spits out tons of error messages, only to have to scroll back up again to find out what happened.
Might be more apt to mention the same authors version of googler for duckduckgo, https://github.com/jarun/ddgr.
Those are both awesome. Are there any options to combine the two?
Maybe use the latter with !g
I wonder how bash would handle that.
gotta quote to prevent shell expansion for bang iirc
Oh, I guess I should be more specific. I want the results from both intertwined.

The top 5 of each, to make a top 10 (deduped).

For dev work I think this would be best.

I was about to say, the main issues with the DDG view is that it's all formatted in a single colour. One colour for links and one for titles is so much better on the eyes! This is a great project!
Didn't work for me so I followed the link to https://git.io/googler-no-results . It looks like it uses a screen scraper. That does not seem like a viable solution to me.
I'm a maintainer of googler (though I haven't put in much work for quite a while) and the author of the linked document. No, it doesn't use a screen scraper, and I don't know how you even got that idea.
Is this perhaps a semantics issue? The linked document mentions parsing HTML, and that layout updates can break it. How would you describe the way googler operates?

Edit: Would ”web scraping” be a more apt description?

Yes, it's a scraper extracting results from HTML. Which is very different from a screen scraper...
What's the use of a text interface if selecting a link leads you to a graphical browser?
You can use whatever textual browser if you want to.
I can't seem to get it to work for any non-trivial search (search results with wikipedia entries, etc)
Thanks, it didn't seem to work for me either. I typed in something really obvious after seeing your comment and I finally got something to display.

Shouldn't there be some kind of message if there are no results or an error? Instead of just showing the next prompt?

This is weird and refreshing idea in the same time

  $ 2 + 2
  [:66] [object Object]
Never change, JavaScript, never change. /s

  -- Type 'm' for more results.
  $ m
  -- End of search results.
Should probably read the help.

Hmm. Well, learned stuff. Still don't know why the above don't work.

They were able to create a fake TTY for searching the web, but they still don't support IPv6.

https://www.reddit.com/r/duckduckgo/search/?q=ipv6&restrict_...

Yeesh, the ignorance of the folks in those threads. Painful.

Anyways, if someone can't get to non-v6 resources, they have bigger problems than not being able to use DDG. There is a single class of operator for whom v6 deployment actually makes sense, which is large-scale ISPs for whom CGNAT presents an onerous burden on their reporting/monitoring requirements to law enforcement.

Everyone else is just rolling v6 out to meet the requirement of a client (typically government) contract. It's purely additive complexity and for most people, doesn't actually solve any problems they really have.

Home internet in Japan is IPv6 only. Usually you have to sign up for a separate NAT-like-thing that the ISP runs as well, sometimes for an additional charge.
Google puts IPv6 adoption rates in Japan slightly behind the US: https://www.google.com/intl/ja/ipv6/statistics.html#tab=per-...

And JPNIC recently discusses how v4 translation is still necessary: https://blog.nic.ad.jp/2021/6406/

I would be super interested to read more about 6to4 translation as an additional charge on residential service, if you have a link I could check out.

OP isn't true but partially true.

Most common and ubiquitous FTTH service (Flets) only provides fiber but no internet connectivity so customer also need to sign up ISP to connect internet. Even without ISP, Flets provides IPv6 address and network service without internet connectivity, but can use VoIP, IPTV, VPN, and other non-internet services.

But generally no individuals sign up only Flets without ISP. Nowadays it's bundled. Most ISP provides IPv4 connectivity via PPPoE. Many ISP also provide IPv6 connectivity, and IPv4 connectivity via v4-over-v6 technology like DS-lite, MAP-E. AFAIK no consumer ISP charges v4-over-v6 service fee if it provides v6 connectivity.

The weird point in Japan is that sometimes said that "IPv4 connection is VERY slow!" because Flets don't want to invest old PPPoE infrastructure much. Instead, Flets and ISP recommend v4-over-v6 service for IPv4 connectivity because they invest it. As a side effect (maybe not side effect), ISP could save usage of global IP addresses.

Still there are some homes use slow v4 and fast v6 connection, due to equipment doesn't support v4-over-v6 or need a global IPv4. So I recommend content providers to enable IPv6 connectivity, especially for CDN.

Ah, this is super interesting. Many thanks for the detailed response!
Wow here in Spain it's the opposite. My provider (JazzTel, part of Orange) still does only IPv4. IPv6 isn't even available if I'd want it. Not that I do, really.. there's no need yet
Everyone else is just rolling v6 out to meet the requirement of a client (typically government) contract.

I'm holding out for ipv8, where someone sensibly just slaps a 1. in front of ipv4 style addresses, which to stacks means route to old ipv4.

Then we have all we need with an extra octlet. We could even reserve a bunch for off-planet communicates, eg 100. = moon, 101 = mars, etc.

All existing tools, code, etc would see, route, etc 4 octlets to 1. addresses. Anything encountering 4 octlets would do the same. Old stuff could function forever, just with no ability to connect beyond 1.

No dual stack, no crazy issues, no 30 year old, broken attempt to re-engineer what didn't need to be done.

What were they thinking?! Yay! Let's eschew simplicity, and instead make a massive change as difficult to upgrade as possible!

Wikipedia quote, 2050...

"IPv6 was a failed standard, an attempt to.... " "replaced by more sensible IPv8..."

One thing to consider is that when IPv6 was invented, there wasn't nearly as big a userbase on IPv4 as there is now. At that time a clean-slate approach made more sense than it does now.

But yes these days things are different. And not all its features imagined to be big have panned out that way (and to be fair, even IPv4 contains several features which are no longer in use).

Is that surprising? A TTY can be built and shipped as a single component - no ISP changes, no revisiting your entire network model, no reviewing every single thing that touches TCP/IP directly (load balancers, logging, HTTP libraries). IPv6 is a big thing to add in comparison.
False equivalences are fun.

While both are technical issues, these are orders of magnitude apart in implementation difficulty, scale, etc. There is no reasonable comparison to be made here.

When visiting this using Chrome for Android, how do I open the keyboard? Typically it's just a matter of giving focus to the input area, but not in this case.
I have the same problem with Firefox for Android.
As a diehard terminal user, I think this headline should interest me. However, I am assuming this is some sort of JavaScript perversion? Visiting the link with lynx gives an empty page. Can anyone explain whats going on there to a non-GUI user?
Keyboard doesn't open on FF Android, so I can't use it (right now) either, but it seems to be a faux shell & TUI for searching DDG.

(I see green on black terminal aesthetic, $ prompt and a flashing cursor - banner text (in the 'shell') above explains I can (if the keyboard would open) run :help (or :send-feedback to tell them the keyboard doesn't w-- oh) which I assume would tell me how to query the search engine.)

Yeah, presumably JS if you can't load it. Though from what I can see without typing anything it could be done in CSS. (I suppose it's probably a SPA - results loaded in place without a page reload which, to be fair, would ruin the faux shell aesthetic.)

Thanks for taking the time to explain what you see. This sort of confirms my initial suspicion. Weird.
(comment deleted)
yes it's just a webpage styled to look like a terminal. not sure what the big deal is
It's JavaScript / jQuery, so yeah it's not going to work in Lynx.
FWIW, the regular (or rather, lite) duckduckgo runs nicely in a TUI browser like elinks. THat's my search engine of choice when text-browsing.
For some reason this does not work with the Vimium browser plugin. Otherwise, very cool!
How to open keyboard on Android? - when visiting from Firefox
I was hoping for something like:

  ssh duckduckgo.com
  grep -r foo news.ycombinator.com
The closest thing I could get working for real was:

  curl -s -X POST https://lite.duckduckgo.com/lite/ -H 'Content-Type: application/x-www-form-urlencoded' -d 'q=foo+site:news.ycombinator.com' | grep 'rel="nofollow"'
A long time ago I wrote goosh (https://goosh.org) which does the same thing for google. It's nice to see something similar for DDG. After a first test it looks like it only searches DDGs public API (so definitions, etc) and doesn't return results from the bing index (a search for "test2" e.g. turns up nothing).
For as much as I love the terminal UI, I don't think the next quantum leap in search functionality can be delivered with it. Assume you have access to an index that is objective / transparent and serves you a (typically) long list of results. The next step is really to make sense and work with the results: you need to quickly and easily filter, order, search within, group or classify or do other bulk operations with all the returned items.

Just like with other "information firehose" environments, like social media feeds, email clients etc, its the "meta search" powers that matter and those are probably better served with GUI's.

Is it just me that this won't search for multiple words? Tried even in double quotes. Only single terms returns any result.
? My Firefox browser always try to open "find" if i press a any key?
Same for me. It seems to be completely broken on Firefox.
two of my favorites are:

> curl wttr.in/berlin

for the weather and

> curl cheat.sh/python/yield

for cheat sheets

This seems to have different result than DDG? Searching for "a320" returns mere 4 results, and anything slightly obscure returns 0.