News for hackers. Stuff that matters.
Re:DuckDuckGo – two non-JavaScript versions of search results by dredmorbius on Friday March 05, 2021 @03:08AM (#26354187)
lite is amazeballs as a command-line utility (leveraging any of several console-mode browsers, including w3m, lynx, links, elinks2, etc.).

As a bash (or zsh) function:

  ddg ()
  {
      /usr/bin/w3m "https://duckduckgo.com/lite?q=$*&kd=-1"
  }
Note that this enables any bang searches as well, though you'll need to single quote these to avoid attempted history expansion.

lite is also my default w3m search bookmark entry.

So:

   ddg '!w foo' # Wikipedia article on foo
   ddg '!dict foo' # Dictionary search on foo
   ddg '!etym foo' # Etymology Dictionary search on foo
Note that if the endpoint itself relies on JS for local search, the bang won't be successful (though DDG will do its bit). Reddit, and HN/Algolia, I'm looking at you.

I happened to be running some quick lookups a few days ago while a friend was watching, and they 1) wondered how I was doing that and 2) if they could have a similar feature. Power of the shell.

Re:DuckDuckGo – two non-JavaScript versions of search results by vanderZwan on Friday March 05, 2021 @05:25AM (#26355191)
Similarly, in Firefox (and maybe other browsers) you can add keywords to bookmarks, meaning that the browser will open that bookmark if you first type the keyword. It will also then insert anything else you type into the bookmarked URL if it has a %s. So as an alternative, more reliable way to search MDN, I bookmarked this:

    https://duckduckgo.com/lite/?q=site%3Adeveloper.mozilla.org+%s
... and gave it the keyword >mdn (I add ">" as a prefix to all my keyworded bookmarks - avoid accidentally triggering or autocompleting to them).

If I'm browsing and need to look something up, I just hit CTRL+L followed by

    >mdn [whatever I'm looking for]
... and off we go
Re:DuckDuckGo – two non-JavaScript versions of search results by dredmorbius on Friday March 05, 2021 @06:36AM (#26355694)
The benefit to bookmarks / keywords is flexibility and not having to wait for DDG to add (or fix) a given bang search.

The downside is that you're speaking your own language, and unless someone adopts your specific keywords, you can't tell them to, say, "bang dict" (if you can get away with saying that in the context).

This is a fundamental distinction between any private vs. shared language.

(People are very uncomfortable when dropped into my computing environment --- GUI, shells, editors, browsers, etc. They've all acquired several decades of personalisation. Works for me.)

Re:DuckDuckGo – two non-JavaScript versions of search results by boogies on Friday March 05, 2021 @08:48AM (#26356802)
Have you heard of Julian Assange’s surfraw?

  $ alias d='sr duckduckgo -text -ducky'
  $ d '!man surfraw'

  [www-browser opens http://manpages.org/surfraw]
  […]
  DESCRIPTION

   Surfraw provides a fast unix command line interface to a variety of popular WWW search engines and other artifacts of power. It reclaims google, altavista, dejanews, freshmeat, research index, slashdot and many others from the false-prophet, pox-infested heathen lands of html-forms, placing these wonders where they belong, deep in unix heartland, as god loving extensions to the shell.
  […]
Edit: even better, dict(1) (or GNU dico):

  $ dict foo # same text as !dict’s http://dict.org/bin/Dict?Form=Dict2&Database=*&Query=foo
Re:DuckDuckGo – two non-JavaScript versions of search results by dredmorbius on Friday March 05, 2021 @11:25AM (#26358625)
Yep, both the tool and its author.

I also use dict, have Debian's gazeteer TIGER files & miscfiles installed, dwww, RFCs, and more.

Info-on-tap is wonderful.

Re:DuckDuckGo – two non-JavaScript versions of search results by rkta on Sunday March 07, 2021 @04:53AM (#26374592)
What is the &kd=-1 for?

edit: To answer my own question https://duckduckgo.com/params

Re:DuckDuckGo – two non-JavaScript versions of search results by mcdevilkiller on Friday March 05, 2021 @04:21AM (#26354769)
Wow, that's amazing!