4 ms·
Can we drop the q= and the quotes from the shell cmd somehow, that would make it so much nicer, and rip is a great command line.
by ykevinator2 5y ago
Can we drop the q= and the quotes from the shell cmd somehow, that would make it so much nicer, and rip is a great command line.
- alangibson 5y agoThere's a real command line coming. If you're on a Debian Linux and feel like testing it out, just do apt install curl jq pip3 install jtbl curl -O https://raw.githubusercontent.com/alangibson/dontbeevil.rip/main/src/rip https://raw.githubusercontent.com/alangibson/dontbeevil.rip/... chmod u+x rip ./rip 'what is a monad'
- l0b0 5y agoWith long options, JSON output, and no extra Python dependencies: rip() { curl \ --data-urlencode "q=${1}" \ --get \ --header 'Content-Type: application/json' --header 'Accept: application/json' \ --silent \ 'https://dontbeevil.rip/search' \ | jq '[ .hits.hits[] | { title: .fields.title[0], url: .fields.url[0], highlight: .highlight.text[0] } ]' }
- alexrsagen 5y agoThis function should work for you: $ rip() { curl -G -H "Accept: text/plain" --url https://dontbeevil.rip/search https://dontbeevil.rip/search --data-urlencode "q=$*"; } $ rip Heartbleed bug edit: alangibson's solution in this thread is better :)