Skip to content

Instantly share code, notes, and snippets.

@moloch--
Created April 7, 2015 00:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moloch--/b3383cf1e7a6aea6f216 to your computer and use it in GitHub Desktop.
Save moloch--/b3383cf1e7a6aea6f216 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import urllib2
from zipfile import ZipFile
from cStringIO import StringIO
ALEXA_URL = "http://s3.amazonaws.com/alexa-static/top-1m.csv.zip"
response = urllib2.urlopen(ALEXA_URL)
alexa = ZipFile(StringIO(response.read()))
for host in alexa.open('top-1m.csv').readlines():
print host
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment