💾 Archived View for tilde.team › ~smokey › cgi-bin › ddg-input.gmi captured on 2024-06-16 at 13:03:48. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-03-20)

-=-=-=-=-=-=-

Duckduckgo Input

!!!EDIT!!!

Duckduckgo Input is now defunct, and to be honest it never worked right anyways. Changes DDG made to their engine make ddg-input non functional. Stargate Relay acts as a sucessor to this project.

Stargate Relay

I leave the following old ddg-input stuff below alone for historical reasons.

This is a script to search duckduckgo inside of the gemini client, meant to be used along side the duckling proxy.

ddg-input.cgi

Chromium? Nah. Firefox? Nope. Qute? Cute. Lynx? Schminx. Browsing the web through your gemini client is the future!

REQUIREMENTS

To get any value out of this CGI you need to have your client pointing to an instance of the duckling proxy either public or self-hosted so that it can convert the HTML data into gemtext for your client to renter.

Duckling Proxy self-Hosting Guide

Acidus's Public Duckling Proxy

!!!BUGS!!!

This script is good for single word queries. However once you introduce spaces the results range from wonky to script-crashing. I assume this has something to do with printf interpeting %20$X as unicode or something and corrupting the print query. I will research better ways of printing without bug, perhaps you know what the problem is and are nice enough to shoot an email? :)

Source

#!/bin/bash

if [ "$QUERY_STRING" = "" ]; then      #If-Else loop to determine wether to send user input request to client or process that input
     printf "10 enter search query\r\n"    #If query string is empty, send a header response code 10 (for input)
  exit;   #Exit from if-else loop
else   #Or else, if query string is not empty
     printf "30 https://www.lite.duckduckgo.com/lite/search?q=$QUERY_STRING\r\n" #send a response header code 30 (redirect) to client pointed at DDG+query URL

fi  #End