search-google
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user