AJAX - The Complete Reference

(avery) #1

508 Part III: Advanced Topics


Of course, as this example shows you need to balance what is difficult for a bot to solve
with what a human can actually read.
When trying to protect content it would make sense to try other schemes such as
randomization of markup structure including id and class values. You might even decide
to put content in less scrapable formats for example putting textual content in a binary format.
Ultimately though, if the user can view the content it, they can get it and can likely automate
it. To keep out automated content scraping, you would just have to monitor for the frequent
access from set IPs and then ban any bot command hooligans who start abusing your site
or application.

Sampling Public Services


In this section we take a brief moment to review public Web Services available when this
book was written. The goal here is not to present a cookbook of usage. Very likely you will
need to visit the services in question for the latest information on syntax and access policies.
Rather, our goal in showing a few examples is to illustrate the range of possibilities, as well
as the typical logistic and technical requirements that will be faced when dealing with
public Web Services.
The first services explored are the Google APIs for search feeds and maps. Information
about each service can be found at http://code.google.com. The first example shows a
simple version of the Google Search API to load in a simple query box that will retrieve
search results in page, Ajax style.
Free download pdf