I have this very simple code to check if a site is up or down.
import httplib2
h = httplib2.Http()
response, content = h.request(\"http://www.folksdhhkjd.com\")
h = httplib2.Http('.cache')
Caches the stuff it retrieves in a directory called .cache
so if you do the same request twice it might not have to actually get everything twice; a file starting with a dot is hidden in POSIX filesystems (like on Linux).
h = httplib2.Http()
Doesn't cache it's results, so you have to get everything requested every time.