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...
Learn a little bit about the new Pastebin.com on our help page. hide message
By Peczenyj on the 8th of Aug 2007 04:27:37 AM Download | Raw | Embed | Report
  1. #!/bin/bash
  2. # author Tiago Peczenyj
  3. # version 0.3 unstable (use for fun)
  4. COR=`echo -ne '\e[31;1m'`
  5. END=`echo -ne '\e[m'`
  6. CORSED="1s/.*/${COR}&${END}/"
  7. GOOGLE='http://www.google.com/search'
  8.  
  9. [[ $2 ]] || { echo "usage: $0 item item2 [ ... item n]" ; exit 0 ; }
  10.  
  11. SEDCMD='/did not match any documents/{s/.*/0/g;p;q}
  12.        /Results/{s/.* about[ ]\+\([0-9,]\+\).*/\1\n/;p;q}'
  13.  
  14. AWKCMD='{ result[$1]=$2 ; x = length($1) ; if(x > max) max=x }
  15.        END{ for(i in result){ a = result[i] ; gsub(",","",a)
  16.                printf "%d\t%-"max"s%24s\n",a,i,result[i]}}'
  17.  
  18. for i in "$@" ; do echo -ne "${i}\t"
  19.         lynx -dump "${GOOGLE}?q=%22${i}%22" | tr -d $'\n' | sed -n "${SEDCMD}"
  20. 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
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: