Google Hacks, 3rd Edition

Book description

Everyone knows that Google lets you search billions of web pages. But few people realize that Google also gives you hundreds of cool ways to organize and play with information.

Since we released the last edition of this bestselling book, Google has added many new features and services to its expanding universe: Google Earth, Google Talk, Google Maps, Google Blog Search, Video Search, Music Search, Google Base, Google Reader, and Google Desktop among them. We've found ways to get these new services to do even more.

The expanded third edition of Google Hacks is a brand-new and infinitely more useful book for this powerful search engine. You'll not only find dozens of hacks for the new Google services, but plenty of updated tips, tricks and scripts for hacking the old ones. Now you can make a Google Earth movie, visualize your web site traffic with Google Analytics, post pictures to your blog with Picasa, or access Gmail in your favorite email client. Industrial strength and real-world tested, this new collection enables you to mine a ton of information within Google's reach. And have a lot of fun while doing it:

  • Search Google over IM with a Google Talk bot
  • Build a customized Google Map and add it to your own web site
  • Cover your searching tracks and take back your browsing privacy
  • Turn any Google query into an RSS feed that you can monitor in Google Reader or the newsreader of your choice
  • Keep tabs on blogs in new, useful ways
  • Turn Gmail into an external hard drive for Windows, Mac, or Linux
  • Beef up your web pages with search, ads, news feeds, and more
  • Program Google with the Google API and language of your choice

For those of you concerned about Google as an emerging Big Brother, this new edition also offers advice and concrete tips for protecting your privacy. Get into the world of Google and bend it to your will!

Publisher resources

View/Submit Errata

Table of contents

  1. Google Hacks, 3rd Edition
  2. A Note Regarding Supplemental Files
  3. Foreword
  4. Credits
    1. About the Authors
    2. Contributors
    3. Acknowledgments
      1. Rael
      2. Paul
      3. Tara
  5. Preface
    1. Why Google Hacks?
    2. How This Book Is Organized
    3. How to Use This Book
    4. How to Run the Hacks
      1. Command-Line Scripts
      2. CGI Scripts
      3. Using the Google API
      4. Learning to Code
    5. Where to Go for More
    6. Conventions Used in This Book
    7. Using Code Examples
    8. Safari® Enabled
    9. How to Contact Us
    10. Got a Hack?
  6. 1. Web
    1. Google Web Search Basics
      1. Phrase Searches
      2. Basic Boolean
      3. Negation
      4. Explicit Inclusion
      5. Synonyms
      6. Number Range
      7. Simple Searching and Feeling Lucky
      8. Case Sensitivity
    2. Full-Word Wildcards
    3. Special Syntax
    4. Mixing Syntax
      1. How Not to Mix Syntax
      2. How to Mix Syntax
        1. Titles and sites
        2. Title and URL
      3. The Antisocial Syntax Elements
      4. All the Possibilities
    5. Advanced Search
      1. Query Words
      2. Language
      3. File Format
      4. Date
      5. Occurrences
      6. Domain
      7. Usage Rights
      8. Safe Search
      9. Page-Specific Search
    6. Quick Links
    7. Language Tools
      1. Search Specific Languages or Countries
      2. Translate
      3. Interface Language
      4. Local Domain
      5. Making the Most of Google’s Language Tools
    8. Anatomy of a Search Result
    9. Setting Preferences
      1. Interface Language
      2. Search Language
      3. SafeSearch Filtering
      4. Number of Results
      5. Results Window
      6. Settings for Researchers
    10. Understanding Google URLs
    11. 1. Browse the Google Directory
      1. Searching Versus Browsing
      2. Searching the Google Directory
    12. 2. Glean a Snapshot of Google in Time
      1. See Also
    13. 3. Visualize Google Results
      1. Starting to Browse
      2. Expanding Your View
      3. Visualization Options
      4. Making the Most of These Visualizations
    14. 4. Check Your Spelling
      1. Embrace Misspellings
      2. Spelling on the Command Line
        1. The code
        2. Running the hack
    15. 5. Google Phonebook: Let Google’s Fingers Do the Walking
      1. The Three Syntaxes
      2. Using the Syntaxes
      3. Caveats
        1. Syntaxes are case-sensitive
        2. Wildcards don’t work
        3. Exclusions don’t work
        4. OR doesn’t always work
      4. Reverse Phonebook Lookup
    16. 6. Look Up Definitions
      1. Google Definitions
      2. Slang
      3. Industrial Slang
      4. Researching Terminology with Google
      5. Where to Go When It’s Not on Google
    17. 7. Find Directories of Information
      1. Title Tags and Wildcards
      2. Finding Searchable Subject Indexes with Google
    18. 8. Cover Your Bases
    19. 9. Hack Your Own Google Search Form
      1. Hidden Variables
      2. Mixing Hidden File Types: an Example
      3. Creating Your Own Google Form
    20. 10. Compare Google and Yahoo! Search Results
      1. Twingine
      2. Yahoo! Versus Google Diagram
      3. Piling Results Together
    21. 11. Cover Your Tracks
      1. Browser History
      2. Saved Form Data
      3. Browser Cache
    22. 12. Improve Google’s Memory
    23. 13. Find Out What Google Thinks ___ Is
      1. The Interface
      2. What You Get Back
      3. Practical Uses
      4. Expanding the Application
    24. 14. Browse the World Wide Photo Album
      1. Random Personal Picture Finder
      2. Searching Personal Sites
    25. 15. Find Similar Images
      1. The Code
      2. Running the Hack
    26. 16. Track Stocks
      1. Beyond Google for Basic Stock Information
      2. More Stock Research with Google
  7. 2. Advanced Web
    1. Assumptions
    2. 17. Assemble Advanced Search Queries
      1. Anatomy of an Advanced Search URL
      2. Building Advanced Search URLs
    3. 18. Like a Version: Search with Synonyms
      1. The Code
      2. Running the Hack
    4. 19. Capture Google Results in a Google Box
      1. The Code
      2. Running the Hack
      3. Integrating a Google Box
      4. The Official Google Box
    5. 20. Cook with Google
      1. The Code
      2. Running the Hack
      3. Hacking the Hack
    6. 21. Permute a Query
      1. The Code
      2. Running the Hack
    7. 22. Summarize Results by Domain
      1. The Code
      2. Running the Hack
      3. Hacking the Hack
        1. Going back for more
        2. Returning comma-separated output
    8. 23. Measure Google Mindshare
      1. The Code
      2. Running the Hack
      3. Fun Hack Uses
    9. 24. SafeSearch Certify URLs
      1. The Code
      2. Running the Hack
      3. Hacking the Hack
    10. 25. Search Google Topics
      1. Why Topic Search?
      2. The Code
      3. Running the Hack
      4. Search Ideas
      5. See Also
    11. 26. Run a Google Popularity Contest
      1. The Code
      2. Running the Hack
    12. 27. Scrape Yahoo! Buzz for a Google Search
      1. The Code
      2. Running the Hack
      3. Hacking the Hack
    13. 28. Compare Google’s Results with Other Search Engines
      1. The Code
      2. Running the Hack
      3. Why?
    14. 29. Scattersearch with Yahoo! and Google
      1. The Code
      2. Running the Hack
      3. Hacking the Hack
    15. 30. Yahoo! Directory Mindshare in Google
      1. The Code
      2. Running the Hack
      3. Hacking the Hack
    16. 31. Spot Trends with Geotargeting
      1. Uses of Geotargeting
      2. The Code
      3. Running the Hack
      4. Hacking the Hack
    17. 32. Bring the Google Calculator to the Command Line
      1. The Code
      2. Running the Hack
    18. 33. Build Your Own Google Search Feeds
      1. The Code
      2. Running the Hack
      3. Hacking the Hack
    19. 34. Search Google by Link Graph
      1. The Code
      2. Running the Hack
      3. See Also
    20. 35. Download Google Videos as AVI Files
      1. Converting FLV Video to AVI
      2. The Code
      3. Running the Hack
  8. 3. News and Blogs
    1. Google News
      1. Google News Search Syntax
      2. Advanced News Search
      3. Making the Most of Google News
      4. Receiving Google News Alerts
    2. Google Groups
      1. Ten Seconds of Hierarchy Funk
      2. Browsing Groups
      3. Google Groups Search Syntax
      4. Mixing Syntaxes in Google Groups
        1. Some common search scenarios
        2. Tech support
        3. Finding commentary immediately after an event
      5. Advanced Groups Search
    3. Blogs
      1. Blogger
      2. Google Blog Search
      3. Google Blog Search Syntax
    4. Beyond Google for News and Blogs
    5. 36. Scrape Google News
      1. The Code
      2. Running the Script
      3. Hacking the Hack
    6. 37. Visualize Google News
    7. 38. Map Google News
      1. Geocoding
      2. The Code
      3. Running the Hack
    8. 39. Track Your Favorite Sites
      1. Finding Feeds
        1. Go to the source
        2. Look for autodiscovery
        3. Look for Add to Google
      2. Adding to Google Homepage
      3. Adding to Google Reader
    9. 40. Scrape Google Groups
      1. The Code
      2. Running the Hack
    10. 41. Seek Out Blog Commentary
      1. Google Blog Search
      2. Google Web Search
        1. Finding “magic words.”
        2. Using these “magic words.”
    11. 42. Glean Blog-Free Google Results
      1. The Code
      2. Running the Hack
      3. Hacking the Hack
    12. 43. Find Blog Commentary for Any URL with a Single Click
      1. The Code
      2. Running the Hack
    13. 44. Track Topics on Blogs over Time
      1. The Code
      2. Running the Hack
      3. Working with the Results
    14. 45. Blog from Your Desktop
      1. w.bloggar
      2. Ecto
        1. Ping services
        2. Tags
      3. Blogger for Word
    15. 46. Program Blogger with PHP
      1. What You Need
      2. The Code
      3. Running the Hack
  9. 4. Extending Google
    1. 47. Keep Tabs on Your Searches with Google Alerts
    2. 48. Google Your Desktop
      1. Installing the Google Desktop
      2. Searching Your Desktop
      3. Google Desktop Search Syntax
      4. Searching the Web
      5. Behind the Scenes
      6. Google Desktop Sidebar
      7. Twiddling Knobs and Setting Preferences
      8. Extending Google Desktop
    3. 49. Google with Bookmarklets
    4. 50. Google from IRC
      1. The Code
      2. Running the Hack
    5. 51. Google on the Go
      1. Google by PDA or Smartphone
      2. Google by Cell Phone
      3. Google by SMS
      4. Froogle on the Go
      5. Maps on the Go
    6. 52. Google over IM
      1. What You Need
      2. The Code
      3. Running the Hack
      4. See Also
    7. 53. Googlify Your Browser
      1. Features
        1. Web search
        2. PageRank
        3. Blog This!
        4. Page information
        5. Spellchecking
      2. Installation
      3. Privacy
    8. 54. Search with Google from Any Web Page
      1. The Code
      2. Running the Hack
    9. 55. Customize the Firefox Quick Search Box
      1. The Code
      2. Running the Hack
    10. 56. Build a Google Screensaver
      1. The Code
      2. Running the Hack
        1. On Mac OS X
        2. On Windows XP
    11. 57. Add a Feed to Google Quickly
      1. Internet Explorer
        1. The code
        2. Running the hack
      2. Firefox
    12. 58. Tame Long Google URLs
      1. Trimming Google URLs
      2. URL-Trimming Services
    13. 59. Autocomplete Search Terms as You Type
      1. The Code
      2. Running the Hack
    14. 60. Refine Your Google Search
      1. The Code
      2. Running the Hack
    15. 61. Make Google More Accessible for Low-Vision Users
      1. The Code
      2. Running the Hack
    16. 62. Search for Lyrics on Google
      1. The Code
      2. Running the Hack
  10. 5. Google Maps
    1. 63. Think Global, Google Local
    2. 64. Get Around http://maps.google.com
      1. What’s Different About Google Maps?
      2. Getting Around
      3. Entering a Location
    3. 65. Find Yourself (and Others) on Google Maps
      1. Odd and Surprising Ways to Find Things
      2. When Locations Fail: The Importance of Context
    4. 66. Build Your Own Google Map
      1. Google Map Maker
      2. Setting Your API Key
      3. Rolling Out Your Map
      4. Hacking the Hack
    5. 67. Add a Google Map to Your Web Site
      1. Get a Developer Key
      2. Hello, World!
      3. Getting Outside of Your Head
      4. Getting Right to the Point
      5. See Also
    6. 68. Map Flickr Contacts
      1. Geocoding a Location
      2. What You Need
      3. The Code
      4. Running the Hack
    7. 69. Fly Across the Earth
      1. Navigating Google Earth
      2. Adding Layers of Information
      3. Sharing Your Locations
  11. 6. Gmail
    1. Signing Up
    2. Gmail Search Syntax
      1. Phrase Searches
      2. Basic Boolean
      3. Negation
      4. Grouping
      5. Mixing Syntax
    3. Gmail Chat
    4. Additional Resources
    5. 70. Create and Use Custom Addresses
    6. 71. Import Your Contacts into Gmail
      1. Anatomy of a Contacts CSV
      2. Feed CSV to Gmail
      3. Out of Outlook (Express)
      4. Hopping Out of Hotmail
        1. By way of Outlook (Express)
        2. By way of copy-and-paste
      5. Yumping from Yahoo!
      6. Moving from .Mac
      7. Hand-Crafting a CSV
      8. Last-Ditch Effort
    7. 72. Import Mail into Gmail
      1. Forward Desktop Mail
        1. Installing the hack
        2. Running the hack
        3. Hacking the hack
      2. Migrate from an Existing Web Mail Service
      3. See Also
    8. 73. Export Your Gmail
      1. Installing the Hack
      2. Running the Hack
      3. See Also
    9. 74. Gmail on the Go
      1. Gmail Mobile
      2. Gmail-mobile PHP
        1. Installing the hack
        2. Running the hack
      3. See Also
      4. Other Options
    10. 75. Use Gmail as a Linux Filesystem
      1. Implementation Details
      2. Installing the Hack
      3. Running the Hack
      4. Things You Should Know
      5. Outstanding Issues
      6. See Also
    11. 76. Use Gmail as a Hard Drive
      1. See Also
    12. 77. Program Gmail
      1. Python
        1. Installing the hack
        2. The code
        3. Running the hack
        4. Hacking the hack
      2. See Also
      3. Perl
      4. PHP
      5. Java
      6. .NET
    13. 78. Force Gmail to Use a Secure Connection
      1. The Code
      2. Running the Hack
      3. Hacking the Hack
  12. 7. Webmastering
    1. Google’s Importance to Webmasters
    2. The Mysterious PageRank
    3. The Equally Mysterious Ranking Algorithm
    4. Tools for Webmasters
      1. Google Sitemaps
      2. Google Analytics
      3. Google AdWords
      4. Google AdSense
    5. Keeping Up with Google’s Changes
    6. In a Word: Relax
    7. 79. A Webmaster’s Introduction to Google
      1. Search Engine Basics
      2. Submitting Your Site to Google
      3. The Search Engine Optimization Template
    8. 80. Get Inside the PageRank Algorithm
      1. What’s the Algorithm?
      2. What Does It Mean?
      3. What’s the Use of the PageRank Calculator?
      4. How Does the PageRank Calculator Work?
    9. 81. 26 Steps to 15 KB a Day
      1. A. Prep Work
      2. B. Choose a Brandable Domain Name
      3. C. Site Design
      4. D. Page Size
      5. E. Content
      6. F. Keyword Density and Keyword Positioning
      7. G. Outbound Links
      8. H. Cross-Links
      9. I. Put It Online
      10. J. Submit
      11. K. Logging and Tracking
      12. L. Spiderings
      13. M. Topic Directories
      14. N. Links
      15. O. Content
      16. P. Gimmicks
      17. Q. Linkbacks
      18. R. Rounding Out Your Offerings
      19. S. Beware of Flyer and Brochure Syndrome
      20. T. Keep Building One Page of Content Per Day
      21. U. Study Those Logs
      22. V. Timely Topics
      23. W. Friends and Family
      24. X. Notes, Notes, Notes
      25. Y. Submission Check at Six Months
      26. Z. Keep Building Those Pages of Quality Content!
    10. 82. Be a Good Search Engine Citizen
      1. Thou Shalt Not:
        1. Cloak
        2. Hide text
        3. Use doorway pages
        4. Check your link rank with automated queries
        5. Link to “bad neighborhoods.”
      2. Thou Shalt:
        1. Create great content
      3. What Happens If You Reform?
      4. What Happens If You Spot Google Abusers in the Index?
    11. 83. Clean Up for a Google Visit
    12. 84. Remove Your Materials from Google
      1. Google Web Search
        1. Making sure your pages never get there to begin with
        2. Removing your pages after they’re indexed
        3. Removing that content now
        4. Reporting pages with inappropriate content
      2. Google Images
      3. Google Groups
        1. Preventing your material from being archived
        2. Removing materials after the fact
      4. Google Phonebook
    13. 85. Get the Most Out of AdWords
      1. Dynamic Keyword Insertion: Beware
      2. Run Better Tests
      3. Run Smarter Reports
      4. Control Your Ad Positions
      5. Don’t Be a Slave to Automation
      6. Control Your Content Bidding
      7. Control Your Geography
    14. 86. Generate Google AdWords
      1. Choosing AdWords
      2. Exploring Your Competitors’ AdWords
    15. 87. Scrape Google AdWords
      1. The Code
      2. Running the Hack
    16. 88. Add Search to Your Site
      1. Google Free
      2. AdSense for Search
    17. 89. Feed News to Your Web Site
      1. Finding a Feed
      2. The Code
      3. Running the Hack
  13. 8. Programming Google
    1. Signing Up and Google’s Terms
    2. The Google Web APIs Developer’s Kit
    3. Using Your Google API Key
    4. What’s WSDL?
    5. Understanding the Google API Query
      1. Query Essentials
      2. A Sample
      3. Intersecting Country, Language, and Topic Restrictions
      4. Putting Query Elements to Use
    6. Understanding the Google API Response
      1. Can Do
      2. Can’t Do
      3. The 10-Result Limit
      4. What’s in the Results
        1. Aggregate data
        2. Individual search result data
    7. Beyond Web APIs
    8. A Note on Spidering and Scraping
    9. 90. Program Google in Perl
      1. The Code
      2. Running the Hack
    10. 91. Install the SOAP::Lite Perl Module
      1. Unix and Mac OS X Installation via CPAN
      2. Unix Installation by Hand
      3. Windows Installation via PPM
      4. A Note About Expat
    11. 92. Program Google with the Net::Google Perl Module
      1. The Code
      2. Running the Hack
    12. 93. Loop Around the 10-Result Limit
      1. The Code
      2. Running the Hack
      3. Hacking the Hack
    13. 94. Program Google in Java
      1. The Code
      2. Compiling the Code
      3. Running the Hack
    14. 95. Program Google in Python
      1. PyGoogle Installation
      2. The Code
      3. Running the Hack
      4. Hacking the Hack
    15. 96. Program Google in C# and .NET
      1. The Code
      2. Compiling the Code
      3. Running the Hack
    16. 97. Program Google in VB.NET
      1. The Code
      2. Compiling the Code
      3. Running the Hack
    17. 98. Program Google with ColdFusion
      1. The Code
      2. Running the Hack
    18. 99. Program Google with PHP 5
      1. The Code
      2. Running the Hack
    19. 100. Program Google with VBScript
      1. What You Need
      2. The Code
      3. Running the Hack
  14. 1. Track News About Google
    1. Google Sources
    2. Outside News Sources
    3. Google Employee Blogs
    4. Grassroots Sources
  15. Index
  16. About the Authors
  17. Colophon
  18. Copyright

Product information

  • Title: Google Hacks, 3rd Edition
  • Author(s): Rael Dornfest, Paul Bausch, Tara Calishain
  • Release date: August 2006
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9780596553708