Bug 856348

Summary: Please add DuckDuckGo to elinks
Product: [Fedora] Fedora Reporter: Prakash S <prakash>
Component: elinksAssignee: Kamil Dudka <kdudka>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: kdudka, ovasik
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: elinks-0.12-0.31.pre5.fc19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-10-08 11:05:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Prakash S 2012-09-11 20:17:17 UTC
Description of problem:
DuckDuckGo is a general purpose search engine with real privacy (we do not collect or share personal information), less spam/clutter and instant answers.  We would like to be included as a search option in Firefox.

Additional info:
Please add https://duckduckgo.com/?q={{search}}&t=fedora so that we can count the number of searches from Fedora.

Opensearch: https://duckduckgo.com/opensearch_ssl.xml

Thanks!

Comment 1 Kamil Dudka 2012-09-11 22:35:01 UTC
Please explain what exactly you mean by "add DuckDuckGo to elinks".

AFAIK, elinks does not have any web-search widget like Firefox.

Comment 2 Prakash S 2012-09-12 09:26:34 UTC
I wasn't aware of elinks not having a search option.  Thanks!

Comment 3 Kamil Dudka 2012-09-12 11:31:01 UTC
We can add a dumb prefix for URI rewriting to the default elinks' configuration:

http://repo.or.cz/w/elinks.git/blob/88be88c:/src/protocol/rewrite/rewrite.c#l112

There is "g " prefix for Google search already.  Is there a similar prefix for DuckDuckGo in any other browser?

Anyway, this is something that we need to negotiate upstream first...

Comment 4 Kamil Dudka 2012-09-12 11:33:33 UTC
Or perhaps a _smart_ prefix.  I am not quite sure why the "g " prefix appears in both of them...

Comment 5 Kamil Dudka 2012-09-12 11:38:33 UTC
Sorry, this is actually explained in the documentation.  "g" without any argument means "just go to http://www.google.com/" (dumb prefix), where as "g expression" tells elinks to search the given expression using Google (smart prefix).

Comment 6 Prakash S 2012-09-12 15:20:56 UTC
Thanks, Kamil.  Can we use a ddg prefix for DuckDuckGo?  Looks like d is being used on dict.org.

Comment 7 Kamil Dudka 2012-09-18 13:12:23 UTC
Prakash, we need to send a patch upstream.  I guess that using "t=fedora" is inappropriate for the upstream patch.  Could we use "t=elinks" or something like that instead?

--- a/src/protocol/rewrite/rewrite.c
+++ b/src/protocol/rewrite/rewrite.c
@@ -121,6 +121,7 @@ static struct option_info uri_rewrite_options[] = {
    INIT_OPT_DUMB_PREFIX("cia", "http://cia.navi.cx/"),
    INIT_OPT_DUMB_PREFIX("b", "http://babelfish.altavista.com/babelfish/tr"),
    INIT_OPT_DUMB_PREFIX("d", "http://www.dict.org"),
+   INIT_OPT_DUMB_PREFIX("ddg", "https://duckduckgo.com/?t=elinks"),
    INIT_OPT_DUMB_PREFIX("g", "http://www.google.com/"),
    INIT_OPT_DUMB_PREFIX("gg", "http://www.google.com/"),
    INIT_OPT_DUMB_PREFIX("go", "http://www.google.com/"),
@@ -158,6 +159,7 @@ static struct option_info uri_rewrite_options[] = {
    INIT_OPT_SMART_PREFIX("cambridge", "http://dictionary.cambridge.org/results.asp?searchword=%s"),
    INIT_OPT_SMART_PREFIX("cliki", "http://www.cliki.net/admin/search?words=%s"),
    INIT_OPT_SMART_PREFIX("d", "http://www.dict.org/bin/Dict?Query=%s&Form=Dict1&Strategy=*&Database=*&submit=Submit+query"),
+   INIT_OPT_SMART_PREFIX("ddg", "https://duckduckgo.com/?q=%s&t=elinks"),
    INIT_OPT_SMART_PREFIX("dmoz", "http://search.dmoz.org/cgi-bin/search?search=%s"),
    INIT_OPT_SMART_PREFIX("foldoc", "http://wombat.doc.ic.ac.uk/foldoc/foldoc.cgi?%s"),
    INIT_OPT_SMART_PREFIX("g", "http://www.google.com/search?q=%s&btnG=Google+Search"),

Comment 8 Prakash S 2012-09-18 13:23:43 UTC
t=elinks works.  Thanks, Kamil.

Comment 9 Kamil Dudka 2012-09-18 13:42:15 UTC
proposed upstream:

http://thread.gmane.org/gmane.comp.web.elinks/3536

Comment 10 Kamil Dudka 2012-10-08 11:05:34 UTC
fixed in elinks-0.12-0.31.pre5.fc19