You are previewing Google Hacks.
O'Reilly logo
Google Hacks

Book Description

The Internet puts a wealth of information at your fingertips, and all you have to know is how to find it. Google is your ultimate research tool--a search engine that indexes more than 2.4 billion web pages, in more than 30 languages, conducting more than 150 million searches a day. The more you know about Google, the better you are at pulling data off the Web. You've got a cadre of techniques up your sleeve--tricks you've learned from practice, from exchanging ideas with others, and from plain old trial and error--but you're always looking for better ways to search. It's the "hacker" in you: not the troublemaking kind, but the kind who really drives innovation by trying new ways to get things done. If this is you, then you'll find new inspiration (and valuable tools, too) in Google Hacks from O'Reilly's new Hacks Series. Google Hacks is a collection of industrial-strength, real-world, tested solutions to practical problems. The book offers a variety of interesting ways for power users to mine the enormous amount of information that Google has access to, and helps you have fun while doing it. You'll learn clever and powerful methods for using the advanced search interface and the new Google API, including how to build and modify scripts that can become custom business applications based on Google. Google Hacks contains 100 tips, tricks and scripts that you can use to become instantly more effective in your research. Each hack can be read in just a few minutes, but can save hours of searching for the right answers. Written by experts for intelligent, advanced users, O'Reilly's new Hacks Series have begun to reclaim the term "hacking" for the good guys. In recent years the term "hacker" has come to be associated with those nefarious black hats who break into other people's computers to snoop, steal information, or disrupt Internet traffic. But the term originally had a much more benign meaning, and you'll still hear it used this way whenever developers get together. Our new Hacks Series is written in the spirit of true hackers--the people who drive innovation. If you're a Google power user, you'll find the technical edge you're looking for in Google Hacks.

Table of Contents

  1. Google Hacks
    1. Credits
      1. About the Authors
      2. Contributors
      3. Acknowledgments
        1. Tara
        2. Rael
    2. Foreword
    3. Preface
      1. Why Google Hacks?
      2. How This Book Is Organized
      3. How to Use This Book
      4. Conventions Used in This Book
      5. How to Contact Us
    4. 1. Searching Google
      1. Hacks #1-28
      2. What Google Isn’t
      3. What Google Is
      4. Google Basics
        1. Basic Boolean
        2. Simple Searching and Feeling Lucky
        3. Just in Case
        4. Other Considerations
      5. The Special Syntaxes
      6. Advanced Search
        1. Query Word Input
        2. Language
        3. Filtering
        4. File Format
        5. Date
      7. Setting Preferences
        1. Language
        2. Filtering
        3. Number of Results
        4. Settings for Researchers
      8. Language Tools
        1. Getting to the Language Tools
        2. Making the Most of Google’s Language Tools
      9. Anatomy of a Search Result
        1. Why Bother?
      10. Specialized Vocabularies: Slang and Terminology
        1. Slang
        2. Using Google with Slang
        3. Specialized Vocabularies—Industrial Slang
        4. Using Specialized Vocabulary with Google
      11. Getting Around the 10 Word Limit
        1. Favor Obscurity
        2. Playing the Wildcard
      12. Word Order Matters
        1. What’s Going On?
        2. Strategies
      13. Repetition Matters
        1. How Does This Work?
        2. A Theory
        3. So What?
        4. See Also
      14. Mixing Syntaxes
        1. The Antisocial Syntaxes
        2. How Not to Mix Syntaxes
        3. How to Mix Syntaxes
          1. Titles and sites
          2. Title and URL
          3. All the possibilities
      15. Hacking Google URLs
        1. Anatomy of a URL
      16. Hacking Google Search Forms
        1. Hidden Variables
        2. Mixing Hidden File Types: An Example
        3. Creating Your Own Google Form
      17. Date-Range Searching
        1. The daterange: Syntax
        2. Searching by Content Creation Date
      18. Understanding and Using Julian Dates
      19. Using Full-Word Wildcards
      20. inurl: Versus site:
        1. How Many Subdomains?
      21. Checking Spelling
        1. Embrace Misspellings
      22. Consulting the Dictionary
      23. Consulting the Phonebook
        1. The Three Syntaxes
        2. Using the Syntaxes
          1. Caveats
          2. Reverse phonebook lookup
          3. Finding phonebooks using Google
      24. Tracking Stocks
        1. Beyond Google for Basic Stock Information
        2. More Stock Research with Google
      25. Google Interface for Translators
      26. Searching Article Archives
        1. Articles from the NYT
        2. Magazine Articles
      27. Finding Directories of Information
        1. Title Tags and Wildcards
        2. Finding Searchable Subject Indexes with Google
      28. Finding Technical Definitions
        1. Technology Terminology
        2. Google Glossary
        3. Researching Terminology with Google
        4. Where to Go When It’s Not on Google
        5. See Also
      29. Finding Weblog Commentary
        1. Finding weblogs
        2. Using These “Magic Words”
      30. The Google Toolbar
      31. The Mozilla Google Toolbar
      32. The Quick Search Toolbar
        1. Basic Browser Use
        2. Triggers and Switches
          1. The triggers
          2. The switches
        3. Navigating Your Searches
        4. And the Rest
        5. See Also
      33. GAPIS
        1. Options
        2. Searching
      34. Googling with Bookmarklets
    5. 2. Google Special Services and Collections
      1. Hacks #29-35
      2. Google’s Current Offerings
        1. Google Answers
        2. Topic-Specific Search
        3. Google of the Future—Google Shopping?
        4. Google in the 2010s
      3. Google Directory
        1. Searching the Google Directory
        2. The Google Directory and the Google API
      4. Google Groups
        1. Ten Seconds of Hierarchy Funk
        2. Browsing Groups
        3. Google Groups and Special Syntaxes
          1. Mixing syntaxes in Google Groups
          2. Some common search scenarios
          3. Tech support
          4. Finding commentary immediately after an event
        4. Google Groups and the Google API
      5. Google Images
        1. Google Images Advanced Search Interface
        2. Google Images Special Syntaxes
        3. Google Images and the Google API
      6. Google News
        1. Special Syntaxes
        2. Making the Most of Google News
        3. Beyond Google for News Search
        4. Google News and the Google API
      7. Google Catalogs
        1. Special Syntaxes
        2. Google Catalogs and the Google API
      8. Froogle
        1. Browsing for Purchases
        2. Searching for Purchases
        3. Adding a Merchant to Froogle
        4. Froogle and the Google API
      9. Google Labs
        1. Google Labs and the Google API
    6. 3. Third-Party Google Services
      1. Hacks #36-40
      2. Of Google, but Not Google
      3. Tinkering with the UI
      4. Expanding the Options with the Google API
      5. Thinking Way Outside the Box
      6. XooMLe: The Google API in Plain Old XML
        1. How It Works
          1. Google Method: doGoogleSearch
          2. Extra Features
          3. Google Method: doSpellingSuggestion
          4. Google Method: doGetCachedPage
          5. Asking XooMLe Something (Forming Requests)
        2. Error Messages
        3. Putting XooMLe to Work: A SOAP::Lite Substitution Module
        4. Using the XooMLe Module
        5. Running the Hack
        6. Applicability
        7. See Also
      7. Google by Email
        1. CapeMail Tricks
      8. Simplifying Google Groups URLs
        1. Other URL-Shortening Options
      9. What Does Google Think Of...
        1. The Interface
        2. What You Get Back
        3. Practical Uses
        4. Expanding the Application
      10. GooglePeople
        1. Using GooglePeople
        2. Tips for Using GooglePeople
          1. Books and authors
          2. Numbers
          3. Mind your questions
        3. Using GooglePeople
    7. 4. Non-API Google Applications
      1. Hacks #41-49
        1. Scraping Versus the API
        2. Why Scrape Google Data?
        3. Things to Keep in Mind While Scraping
        4. Using Scraped Data Files
        5. Not Fancy but Handy
      2. Don’t Try This at Home
        1. Don’t Try These at Home
        2. Other Programs to Be Concerned About
      3. Building a Custom Date-Range Search Form
        1. The Form
        2. The Code
        3. Hacking the Hack
      4. Building Google Directory URLs
        1. The Code
        2. Running the Hack
        3. The Results
        4. Hacking the Hack
      5. Scraping Google Results
        1. The Code
        2. Running the Script
        3. The Results
      6. Scraping Google AdWords
        1. The Code
        2. How It Works
        3. The Results
        4. Hacking the Hack
        5. See Also
      7. Scraping Google Groups
        1. Saving Pages
        2. Scraping Caveats
        3. The Code
        4. Running the Hack
        5. The Results
      8. Scraping Google News
        1. The Code
        2. Running the Script
        3. The Results
        4. Hacking the Hack
      9. Scraping Google Catalogs
        1. The Code
        2. Running the Script
        3. The Results
        4. Hacking the Hack
      10. Scraping the Google Phonebook
        1. The Code
        2. Running the Hack
    8. 5. Introducing the Google Web API
      1. Hacks #50-59
      2. Why an API?
      3. Signing Up and Google’s Terms
      4. The Google Web APIs Developer’s Kit
      5. Using the Key in a Hack
      6. What’s WSDL?
      7. Understanding the Google API Query
        1. Query Essentials
        2. A Sample
        3. Intersecting Country, and Topic Restrictions
        4. Putting Query Elements to Use
      8. 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
      9. Programming the Google Web API with Perl
        1. The Code
        2. Running the Hack
        3. The Results
        4. See Also
      10. Looping Around the 10-Result Limit
        1. The Code
        2. Running the Script
        3. The Results
        4. See Also
      11. The SOAP::Lite Perl Module
        1. SOAPing your ISP
        2. Installing SOAP::Lite
          1. Unix and Mac OS X installation via CPAN
          2. Unix installation by hand
          3. Windows installation via PPM
        3. SOAP::Lite Alternatives
      12. Plain Old XML, a SOAP::Lite Alternative
        1. The Code
        2. Running the Hack
        3. The Results
        4. Applicability and Limitations
        5. See Also
      13. NoXML, Another SOAP::Lite Alternative
        1. The Code
        2. Running the Hack
        3. The Results
        4. Applicability and Limitations
        5. See Also
      14. Programming the Google Web API with PHP
        1. The Code
        2. Running the Hack
        3. The Results
      15. Programming the Google Web API with Java
        1. The Code
        2. Compiling the Code
        3. Running the Hack
        4. The Results
      16. Programming the Google Web API with Python
        1. PyGoogle Installation
        2. The Code
        3. Running the Hack
        4. The Results
        5. Hacking the Hack
      17. Programming the Google Web API with C# and .NET
        1. The Code
        2. Compiling the Code
        3. Running the Hack
        4. The Results
      18. Programming the Google Web API with VB.NET
        1. The Code
        2. Compiling the Code
        3. Running the Hack
        4. The Results
    9. 6. Google Web API Applications
      1. Hacks #60-85
      2. The Ingenuity of Millions
      3. Learning to Code
      4. What You’ll Find Here
      5. Finding More Google API Applications
      6. The Possibilities Aren’t Endless, but They’re Expanding
      7. Date-Range Searching with a Client-Side Application
        1. The Queries
        2. The Code
        3. Running the Hack
        4. The Results
        5. Hacking the Hack
      8. Adding a Little Google to Your Word
        1. Using CapeSpeller
      9. Permuting a Query
        1. The Code
        2. Running the Hack
        3. Using the Hack
      10. Tracking Result Counts over Time
        1. The Code
        2. Running the Hack
        3. The Results
        4. Working with These Results
        5. Hacking the Hack
      11. Visualizing Google Results
        1. Starting to Browse
        2. Expanding Your View
        3. Visualization Options
        4. Making the Most of These Visualizations
      12. Meandering Your Google Neighborhood
        1. The Code
        2. Running the Hack
        3. Hacking the Hack
          1. Noticing/ignoring file extensions
          2. Ignoring domains
      13. Running a Google Popularity Contest
        1. The Code
        2. Running the Hack
      14. Building a Google Box
        1. What’s a Google Box?
        2. Google Box
        3. Google Boxes Everywhere
          1. Radio Userland
          2. Movable Type
          3. Other implementations
        4. What’s in Your Google Box?
        5. The Code
        6. Running the Hack
        7. The Results
        8. Integrating a Google Box
      15. Capturing a Moment in Time
        1. Making the Google Box Timely
        2. The Code
        3. Running the Hack
        4. The Results
        5. Hacking the Hack
        6. Running the Hacked Hack
      16. Feeling Really Lucky
        1. The Code
        2. Hacking the Hack
      17. Gleaning Phonebook Stats
        1. The Code
        2. Running the Hack
        3. Results
        4. Hacking the Hack
          1. Residential, business, or both
          2. The cities
        5. The 600-Foot Ceiling
      18. Performing Proximity Searches
        1. Making the Most of GAPS
        2. The Code
        3. Other Staggernation Scripts
      19. Blending the Google and Amazon Web Services
        1. How It Works
        2. The Modules
          1. AmazonAPI
          2. GoogleAPI
        3. The Template
        4. The CGI Script
        5. Running the Hack
      20. Getting Random Results (On Purpose)
        1. The Code
        2. The Code
        3. Running the Hack
        4. Hacking the Hack
          1. Modifying the modifiers
          2. Adding a touch more randomness
      21. Restricting Searches to Top-Level Results
        1. The Code
        2. Running the Hack
        3. Hacking the Hack
          1. More depth
          2. Query tips
      22. Searching for Special Characters
        1. The Code
        2. Hacking the Hack
          1. Choosing special characters
          2. Excluding special characters
      23. Digging Deeper into Sites
        1. The Code
        2. Running the Hack
        3. Hacking the Hack
        4. See Also
      24. Summarizing Results by Domain
        1. The Code
        2. Running the Hack
        3. The Results
        4. Hacking the Hack
          1. Going back for more
          2. Comma-separated
      25. Scraping Yahoo! Buzz for a Google Search
        1. The Code
        2. Running the Hack
        3. The Results
        4. Hacking the Hack
      26. Measuring Google Mindshare
        1. The Code
        2. Running the Hack
        3. Fun Hack Uses
      27. Comparing Google Results with Those of Other Search Engines
        1. The Code
        2. Running the Hack
        3. Why?
      28. SafeSearch Certifying URLs
        1. Danger Will Robinson
        2. The Code
        3. Running the Hack
        4. Hacking the Hack
      29. Syndicating Google Search Results
        1. Running the Hack
      30. Searching Google Topics
        1. Why Topic Search?
        2. The Code
        3. Running the Hack
        4. Search Ideas
      31. Finding the Largest Page
        1. The Code
        2. Running the Hack
        3. Usage Examples
        4. Hacking the Hack
      32. Instant Messaging Google
        1. The Code
    10. 7. Google Pranks and Games
      1. Hacks #86-92
      2. The No-Result Search (Prank)
        1. Hacking the URL
        2. Hacking the Search
        3. Delivering the Prank
      3. Google Whacking
        1. Running the Hack
        2. The Results
      4. GooPoetry
        1. The Code
        2. Running the Hack
        3. Hacking the Hack
      5. Creating Google Art
        1. Making Your Own Art
      6. Google Bounce
        1. The Code
        2. See Also
      7. Google Mirror
      8. Finding Recipes
        1. Using the Hack
        2. Hacking the Hack
        3. Finding New Recipe Domains
    11. 8. The Webmaster Side of Google
      1. Hacks #93-100
      2. Google’s Preeminence
      3. Google’s Importance to Webmasters
      4. The Mysterious PageRank
      5. The Equally Mysterious Algorithm
      6. Google’s Ad Programs
      7. Keeping Up with Google’s Changes
      8. In a Word: Relax
      9. A Webmaster’s Introduction to Google
        1. Search Engine Basics
        2. Submitting Your Site to Google
        3. The Search Engine Optimization Template
      10. Generating Google AdWords
        1. Choosing AdWords
        2. Exploring Your Competitors’ AdWords
        3. See Also
      11. Inside the PageRank Algorithm
        1. What Is PageRank?
        2. So What Is the Algorithm?
        3. And What Does This Mean?
        4. So What’s the Use of the PageRank Calculator?
        5. How Does the PageRank Calculator Work?
      12. 26 Steps to 15K 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!
      13. Being a Good Search Engine Citizen
        1. Thou shalt not:
        2. Thou shalt:
        3. What Happens if You Reform?
        4. What Happens if You Spot Google Abusers in the Index?
      14. Cleaning Up for a Google Visit
      15. Getting the Most out of AdWords
        1. Matching Can Make a Dramatic Difference
        2. Copywriting Tweaks Generally Involve Improving Clarity and Directness
        3. Be Inquisitive and Proactive with Editorial Policies (But Don’t Whine)
        4. Avoid the Trap of “Insider Thinking” and Pursue the Advantage of Granular Thinking
        5. See Also
      16. Removing Your Materials from Google
        1. Google’s 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. Removing Material from Google Groups
          1. Preventing your material from being archived
          2. Removing materials after the fact
        4. Removing Your Listing from Google Phonebook
    12. Index
    13. Colophon