Meander Your Google Neighborhood

Google Neighborhood attempts to detangle the Web by building a “neighborhood” of sites around a URL.

It’s called the World Wide Web, not the World Wide Straight Line. Sites link to other sites, building a web of sites. And what a tangled web we weave.

Google Neighborhood by the Python-wise Mark Pilgrim (http://diveintomark.org) attempts to detangle some small portion of the Web by using the Google API to find sites related to a URL that you provide, scraping the links on the sites returned and building a “neighborhood” of sites that link both the original URL and each other.

If you’d like to give this hack a whirl without having to run it yourself, there’s a live version available at http://diveintomark.org/archives/2002/06/04/who_are_the_people_in_your_neighborhood. The source code (included in the following section) for Google Neighborhood is available for download from http://diveintomark.org/projects/misc/neighbor.py.txt.

The Code

Google Neighborhood is written in the Python (http://www.python.org) programming language. Your system will need to have Python installed for you to run this hack.

"""Blogroll finder and aggregator""" __author_ _ = "Mark Pilgrim (f8dy@diveintomark.org)" __copyright_ _ = "Copyright 2002, Mark Pilgrim" __license_ _ = "Python" try: import timeoutsocket # http://www.timo-tasi.org/python/timeoutsocket.py timeoutsocket.setDefaultSocketTimeout(10) except: pass import urllib, urlparse, os, time, operator, sys, pickle, re, cgi, ...

Get Google Hacks, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.