💾 Archived View for tilde.team › ~smokey › cgi-bin › ddg-input.gmi captured on 2022-07-16 at 13:51:06. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
This is a script to search duckduckgo inside of the gemini client, meant to be used along side the duckling proxy.
Chromium? Nah. Firefox? Nope. Qute? Cute. Lynx? Schminx. Browsing the web through your gemini client is the future!
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
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? :)
#!/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