search-google
This commit is contained in:
@@ -2,13 +2,11 @@
|
|||||||
|
|
||||||
q="$*"
|
q="$*"
|
||||||
[ -z "$q" ] && q="$(cat)"
|
[ -z "$q" ] && q="$(cat)"
|
||||||
|
|
||||||
# encode espace → +
|
|
||||||
q="${q// /+}"
|
q="${q// /+}"
|
||||||
|
|
||||||
ua="Mozilla/5.0"
|
curl -s -L \
|
||||||
|
-A "Mozilla/5.0" \
|
||||||
curl -s -A "$ua" "https://www.google.com/search?q=$q&hl=en" \
|
-b "CONSENT=YES+1" \
|
||||||
| grep -oP '(?<=<a href="/url\?q=)[^&]+' \
|
"https://www.google.com/search?q=$q&hl=en&udm=14" \
|
||||||
| sed 's/%25/%/g' \
|
| grep -oP '(?<=href="/url\?q=)[^&]+' \
|
||||||
| head -n 5
|
| head -n 5
|
||||||
|
|||||||
Reference in New Issue
Block a user