Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Limit Google searches by date (See related posts)

See: Easy Way to Find Recent Web Pages

date='d15'
date='m3'
date='y'
words='unix linux shell bash'
site='codesnippets.joyent.com'

open -a Safari "http://www.google.com/search?q=${words// /+}&as_qdr=${date}"

open -a Safari "http://www.google.com/search?q=site%3A${site}%20${words// /+}&as_qdr=${date}"


# sbd - search by date
# cf. also http://codesnippets.joyent.com/posts/show/1700

function sbd() {
   declare date site words
   date="${1}"
   words="${2}"
   site="${3}"
   if [[ $# -eq 2 ]]; then
      /usr/bin/open -a Safari "http://www.google.com/search?q=${words// /+}&as_qdr=${date}"
   elif [[ $# -eq 3 ]]; then
      /usr/bin/open -a Safari "http://www.google.com/search?q=site%3A${site}%20${words// /+}&as_qdr=${date}"
   else
      return 1
   fi
   return 0
}


sbd d 'unix linux shell bash'
sbd m5 'unix linux shell bash'
sbd y3 'unix linux shell bash' codesnippets.joyent.com

You need to create an account or log in to post comments to this site.