Created
November 5, 2010 17:37
-
-
Save ideamonk/664497 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
''' | |
To my surprise texter3 is still alive, the first fish in this pond was | |
caught on 08-24-07, so I assume there is about 3 years of data locked in this | |
amber. | |
Yet more surprising part was to see a box with status - alive and DOB : 02-05-10 | |
Truly proud to have written long surviving dirty little rats when I was young :) | |
A great credit goes to (8bits)host for freely running it so far. | |
''' | |
import os | |
import urllib2 | |
from multiprocessing import Pool | |
def fetch(i): | |
data = urllib2.urlopen("http://texter3.HOLYFREEHOST.com/data/" + str(i) + "/view.php").read() | |
f = open(os.path.join("./data/",str(i) + ".txt"), "w+") | |
try: | |
f.write(data) | |
print "Done %d" % i | |
except: | |
print "Failed - %d" %i | |
f.close() | |
if __name__ == '__main__': | |
pool = Pool(processes=4) | |
for i in xrange(1,138): | |
print "adding %d" % i | |
pool.apply_async(fetch, (i,)) | |
pool.close() | |
pool.join() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment