O'Reilly Network    
 Published on O'Reilly Network (http://www.oreillynet.com/)
 See this if you're having trouble printing code examples


Using Google to View MySpace or Any Restricted Site

by Wei-Meng Lee
12/21/2006

Editor's Note: A year ago, a reader with the handle of bigthistle posted one of our favorite hacks to hacks.oreilly.com, describing how to access restricted websites using the Google Translate feature. Acknowledging that our readers often have better ideas than we do, we recently asked Wei-Meng Lee to take a closer look at this technique, and he wrote up this awesome HOWTO based on the original submitted hack. For many more innovative ways to use Google, get your hands on a copy of our recently released Google Hacks, Third Edition.

Most companies and schools employ proxy servers to filter unwanted sites so employees won't waste precious company resources surfing sites that the companies deem unproductive. While the use of proxy servers to block unwanted sites may be understandable in commercial cases, there are also companies that are overdoing it, banning almost all websites and creating a lot of inconvenience to their employees.

If you are in such an environment, what can you do about it? One way is to use an anonymous proxy server (such as http://www.spysurfing.com/). But once the system administrator learns about this, he will likely block this site as well. A much more foolproof way is to use Google (yes, you read that right). In this article I will show you three ways to use Google to bypass a proxy server.

Google Translate

Google Translate is a translation service provided by Google to help you translate text or web pages to the language you desire. Some of the languages supported include English, Simplified Chinese, Spanish, French, German, Korean, Japanese, etc.

If you want to translate a page from one language to another, here is the URL format:

http://www.google.com/translate?langpair=en|es&u=www.websiteurl.com

where en|es is the language pair to translate from one language to the other (here it is English to Spanish), and www.websiteurl.com is the site you want to translate.

An interesting workaround to bypass your proxy server is to use Google Translate to translate the page you want to view from English to English, like this:

http://www.google.com/translate?langpair=en|en&u=www.websiteurl.com

Here, since the origin language and the destination language are the same, Google Translate does not perform any translation and hence simply acts as a forwarder and forwards the page you want to view directly to you. As an example, if your workplace/school has blocked MySpace.com, you can use the following URL to view it:

http://www.google.com/translate?langpair=en|en&u=www.myspace.com

Figure 1
Figure 1. Viewing MySpace.com through Google Translate

If you want to view MySpace.com in Simplified Chinese, use the following URL (see Figure 2 for the result):

http://www.google.com/translate?langpair=en|zh&u=www.myspace.com

Figure 2
Figure 2. Viewing MySpace.com in simplified Chinese through Google Translate

Using Google Translate to bypass your proxy servers does not work all of the time. In some instances, it does not work at all. And in some cases, Google Translate will only display the text of the site you want to view (the images will not load), while in other cases you may need to translate the page to other languages before you can view its content. In any case, try out the different combinations described in this section and if it still doesn't work, check out the next section.

Google Mobile

Another great way to bypass your proxy server is by using Google Mobile. Google Mobile is designed to let users perform a Google Search on their mobile phones. As such, the result returned by Google Mobile is automatically formatted to fit on small screen devices.

To use Google Mobile to load a site, use the following URL format:

http://www.google.com/gwt/n?u=www.websiteurl.com

For example, the following URL will load YouTube.com:

http://www.google.com/gwt/n?u=www.youtube.com

Figure 3
Figure 3. Loading YouTube.com via Google Mobile

In my testing, I found that using Google Mobile is very effective in bypassing the proxy server. The only problem is the page display, which requires you to click several times in order to view a complete page. But heck! If you can view a banned site, what are you complaining about?

Google Cache

The last technique to bypass your proxy server is to use the Google Cache. When you search for something, Google will return the sites that match your search keywords and, if possible, at the same time present its own cached version. It is highly likely that the site you want has already been cached by Google. For example, Figure 4 shows the search result when I searched for MySpace.com.

Figure 4
Figure 4. Using Google to search for MySpace.com

Clicking on the Cached link shows me the home page of MySpace.com (see Figure 5).

Figure 5
Figure 5. Viewing the cached snapshot of MySpace.com

Using this technique, you should be able to view most of the sites you want. The only downside to this is that the content cached by Google might be outdated, and some images may not load at all.

Summary

In this article, you have seen three ways to use Google to bypass your proxy server. Because Google is such a popular search engine, it is unlikely that your administrator will "blacklist" it. Have fun with Google!

It should be noted that not all of these techniques are necessarily unique to Google. Some of these methods will also work with the other major search engines; for instance, the Cache method works the same way on Yahoo Search and MSN Live. Yahoo also provides a translation service called Babel Fish that can similarly forward web pages, but it does not offer an English-to-English translation option.

Wei-Meng Lee (Microsoft MVP) http://weimenglee.blogspot.com is a technologist and founder of Developer Learning Solutions http://www.developerlearningsolutions.com, a technology company specializing in hands-on training on the latest Microsoft technologies.


Return to the O'Reilly Network.

Copyright © 2009 O'Reilly Media, Inc.