Friday, October 29, 2010
Tuesday, October 19, 2010
I use the -findit- command from the Stata command line/window dozens of times a day. However, I've always wished that there was a way to have -findit- search for than just Stata commands or materials on the web so that I wouldn't have to leave the Stata window just to Google something.
Also, I've always wanted -findit- to search Statalist archives for me as part of the process of looking for an answer to some burning Stata-related question. Now, you can stay tethered to Stata and Google with impunity without ever leaving the safety of your Stata command line.
The ado-file described below allows you to Google something from the Stata command line and have the results either return to you in the Stata "Results" window (default) or export to your system's browser. The title of the results webpages are returned and the links in blue are clickable to navigate to that page in your OS default browser.
The syntax is:
[ , Filetype(string) Site(string) STATAlist
where [options] are defined as:
Filetype - Specify the filetype to search for. E.g., pdf, txt, doc, gif, etc.
Site - Specify the site/domain to search within. E.g., www.google.com, http://www.nyt.com
Statalist - Search within Statalist archives only (via http://www.stata.com/statalist/archive/)
Issues Google search to system's default browser rather than the Results Window (default)
Chrome - (For Mac OSX only) Will redirect browser command to Chrome Browser, if installed
-google- requires that the package -intext- (downloadable from SSC or using -ssc install intext-) is installed. -google- will auto-detect and install -intext- from web-aware Stata during its initial run.
See my software page for more on this code & other software I've written for Stata and Mac OSX.