search-google

This commit is contained in:
Your Name
2026-04-01 11:54:53 +02:00
parent e602b71068
commit ace4375f17
+5 -7
View File
@@ -2,13 +2,11 @@
q="$*"
[ -z "$q" ] && q="$(cat)"
# encode espace → +
q="${q// /+}"
ua="Mozilla/5.0"
curl -s -A "$ua" "https://www.google.com/search?q=$q&hl=en" \
| grep -oP '(?<=<a href="/url\?q=)[^&]+' \
| sed 's/%25/%/g' \
curl -s -L \
-A "Mozilla/5.0" \
-b "CONSENT=YES+1" \
"https://www.google.com/search?q=$q&hl=en&udm=14" \
| grep -oP '(?<=href="/url\?q=)[^&]+' \
| head -n 5