Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
DuckDuckGo as a TTY (duckduckgo.com)
234 points by tentacleuno on Oct 20, 2021 | hide | past | favorite | 91 comments


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


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


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 wonder how bash would handle that.


gotta quote to prevent shell expansion for bang iirc


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.


What is NNN?


Appears to be a file manager

https://github.com/jarun/nnn


Aha. Thank you.


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.


Also check if your terminal supports Shift-PgUp/PgDn to scroll up/down a page.

Works in gnome terminal: https://help.gnome.org/users/gnome-terminal/stable/adv-keybo...


  $ 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_...


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.


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!


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).


Wikipedia quote, 2050...

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


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.


The app will have to be reimplemented in a way that doesn't screw up the input.

<https://zserge.com/posts/js-editor/>


I have the same problem with Firefox for Android.


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"'


Ge surfraw.


If I type \\+<enter> a new page opens here: https://maps.clarkcountynv.gov/openweb/?@772725,26784494,9

Showing me somebody's house, their name and address, etc.

Now I'm curious why. Note that I am not located anywhere near there.


Okay, I tried a few things out and I think I understand what happened. "\" is "I'm Feeling Lucky" for a search. You can even see this in regular DuckDuckGo, for example if you search "\wikipedia". The "\+" part is more of an coincidence. If you search "\+" with the quotes[0], you can see that the Clark County page is one of the first results. So, it appears that the query "\\+" is asking to search "\+" and open the top result, and that link just happens to be the result (even if it appears seconded when searching for an exact instance of "\+").

[0] https://duckduckgo.com/?q=%22%5C%2B%22&t=h_&ia=web


Ah, okay. It's a different suburban Las Vegas house every time too, which is also odd. Same on the regular ddg website. The "parcelid" changes for each search of "\+" on their site.


That is weird... does the same thing for me. I'm in CA and that's vegas suburbs. So I'm not that close either.


Ditto that - I'm in MD


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?


Also this[1] is nice for non-javascript interfacing with DDG.

https://help.duckduckgo.com/duckduckgo-help-pages/features/n...


I would love this as an actual command or even a telnet/ssh server!


there is this: https://github.com/jarun/ddgr

I have not tried it yet, but might fill your need.


Get surfraw and use Links as the browser.


Very cool. Now please let me access it over SSH.


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.


Does anyone know end game for DuckDuckGo? Are they waiting to be acquired or hoping they will replace Google at what they do best? I want to use DDG but it just doesn't cut it for regular use.


I find they absolutely cut it for regular use, it's the irregular, special times where it doesn't but then I have to use the g! Operator


That is what I thought too when I first started using them. "They just aren't as good as Google!". I have found this to not be the case as often as I thought it would be. In fact, 90% of my searches I'd say never require me to leave Duck Duck Go to find the answer, that includes technical queries.

That isn't to say that DDG is perfect, but for the times that it isn't perfect tacking an !g or !b to the end of the search does the job.


First test:

    $ 6km in miles
    [:1] [object Object]


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).


? 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.


If using web search using textual tty interface was useful for something, I would want to do it via my existing terminal program, not via browser.

But, is it useful for anything at all?


I think it has a pretty small market:

    $ :why
    Because Devdas uses vimperator with Google?? I don't think they mix well. Devdas, you should try this instead.


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?


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


Is it just me that this won't search for multiple words? Tried even in double quotes. Only single terms returns any result.


I searched for "DROP TABLE search_index" and then after that everything stopped working.

Did anyone else experience the same?


Yes, saw that too. Functionality is really limited. It's basically a Wikipedia command line parser. For instance, "current weather in Los Angeles" brings up nothing. "Current president of the USA" brings up nothing. But 2020 World Series Champion brings up a Wikipedia style summary.


For some reason this does not work with the Vimium browser plugin. Otherwise, very cool!


Nice, "install chrome" yields 0 results!

Edit: Apparently "install" is a keyword.


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!


yeah, it's broken for every search I tried



two of my favorites are:

> curl wttr.in/berlin

for the weather and

> curl cheat.sh/python/yield

for cheat sheets


How to open keyboard on Android? - when visiting from Firefox


I love this. Can I do this in my terminal without lynx


It seems a command-line tool exists for DuckDuckGo[0], so yes.

[0]: https://news.ycombinator.com/item?id=28941294


This is weird and refreshing idea in the same time


typing in the search term "meeple" does not seem to do anything.


s/tty/repl/g


at least `ls` works!


yes!


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.


Maybe this will be an alternative interface that suits you: https://github.com/jarun/ddgr

There's also these JS-free interfaces: https://html.duckduckgo.com/html https://lite.duckduckgo.com/lite


yes it's just a webpage styled to look like a terminal. not sure what the big deal is


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.


It's JavaScript / jQuery, so yeah it's not going to work in Lynx.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: