Recent Posts
None | 39 sec ago
None | 39 sec ago
C# | 1 min ago
None | 1 min ago
None | 1 min ago
None | 1 min ago
C++ | 2 min ago
None | 2 min ago
None | 2 min ago
None | 2 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
By Peczenyj on the 8th of Aug 2007 04:27:37 AM
Download |
Raw |
Embed |
Report
#!/bin/bash
# author Tiago Peczenyj
# version 0.3 unstable (use for fun)
COR=`echo -ne '\e[31;1m'`
END=`echo -ne '\e[m'`
CORSED="1s/.*/${COR}&${END}/"
GOOGLE='http://www.google.com/search'
[[ $2 ]] || { echo "usage: $0 item item2 [ ... item n]" ; exit 0 ; }
SEDCMD='/did not match any documents/{s/.*/0/g;p;q}
/Results/{s/.* about[ ]\+\([0-9,]\+\).*/\1\n/;p;q}'
AWKCMD='{ result[$1]=$2 ; x = length($1) ; if(x > max) max=x }
END{ for(i in result){ a = result[i] ; gsub(",","",a)
printf "%d\t%-"max"s%24s\n",a,i,result[i]}}'
for i in "$@" ; do echo -ne "${i}\t"
lynx -dump "${GOOGLE}?q=%22${i}%22" | tr -d $'\n' | sed -n "${SEDCMD}"
done | awk -F '\t' "${AWKCMD}" | sort -nr | cut -d $'\t' -f 2- | sed "${CORSED}"
Submit a correction or amendment below.
[ previous version ] | [ difference ] | Make A New Post