# Documentation:
# @raycast.author Your Name
# @raycast.authorURL https://github.com/you
QUERY="$1"
[ -z "$QUERY" ] && exit 0
FULL_QUERY="Answer in as little words as possible, concisely, for an intelligent person: $QUERY"
# URL encode (pure bash)
encode_query() {
local query="$1"
local encoded=""
local c
for (( i=0; i<${#query}; i++ )); do
c="${query:$i:1}"
case $c in
[a-zA-Z0-9.~_-]) encoded+="$c" ;;
*) encoded+=$(printf '%%%02X' "'$c") ;;
esac
done
echo "$encoded"
}
If you watch Computer Chronicles, you will notice that little to nothing has actually changed in computing in 40 years.
reply