Topic: https://brettterpstra.com/2012/08/22/lucky-duck/
hide preview

What's next? verify your email address for reply notifications!

Lri 12y, 210d ago

I don't know why, but there's spaces and a newline after the URL when for example searching for aa.

This probably won't work in all cases either, but here's a shell version: curl -s "http://duckduckgo.com/?q=%5C$(ruby -e 'require "cgi"; print CGI.escape(STDIN.read.chomp)' <<< example)" | sed -E "s/.*window\.location\.replace\('([^' ]+).*/\1/".

remark link
hide preview

What's next? verify your email address for reply notifications!

Brett 12y, 210d ago

That's not happening for me at all, but try putting #{res.strip} in the output instead of #{res} and see what happens.

hide preview

What's next? verify your email address for reply notifications!