Last active
January 4, 2016 01:49
-
-
Save XayOn/8550978 to your computer and use it in GitHub Desktop.
Some searcher functions in bash with wget and some regex magic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
google(){ export ua="Mozilla/5.0 (Linux; U; Android 0.5; en-us) AppleWebKit/522+ (KHTML, like Gecko) Safari/419.3"; ( for i in $(seq 0 $2); do wget -O - --user-agent="$ua" "https://www.google.es/search?safe=off&output=search&sclient=psy-ab&q=$1&start=$((i * 10 ))"; done ) 2>/dev/null | grep -o '<a href=['"'"'"][^"'"'"']*['"'"'"]' | sed -e 's/^<a href=["'"'"']//' -e 's/["'"'"']$//'|egrep -v "^/|^#|google|javascript:void";} | |
github(){ google "site:github.com $1" 1|egrep '^https://github.com/[[:alnum:]]{0,40}/[-[:alnum:]]{0,40}$'; } | |
google_feelinglucky(){ google ${@} |head -n1; } | |
github_feelinglucky(){ github ${@} |head -n1; } | |
# git clone $(github_feelinglucky nanobenv); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment