Files
py_sandbox/misc/wget_batch.py
Andreas 8f7760b2aa reorganising projects
--HG--
branch : sandbox
2009-10-24 15:00:35 +00:00

53 lines
1.5 KiB
Python

""" broker quote request recorder engine """
import logging
import getopt
import sys
import datetime
mylog = logging.getLogger()
class Usage(Exception):
def __init__(self, message):
Exception.__init__(message)
class Error(Exception):
def __init__(self, message):
Exception.__init__(message)
def main(argv = None):
if argv == None:
argv = sys.argv
mylog.info("starting [%s]" % (argv[0],))
try:
try:
opts, args = getopt.getopt(argv[1:], "h", ["help"])
print "opts: ", opts, "args:", args
except getopt.error, msg:
raise Usage(msg)
# set up stderr logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s.%(msecs)03d %(levelname)-8s %(message)s',
datefmt='%H:%M:%S')
# main code starts here
ofh = open("e:/install/asstr_get", "w")
for i in xrange(56546,57096):
# print >> ofh, "wget http://www.literotica.com/stories/showstory.php?id=%i" % i
print >> ofh, "wget http://www.asstr.org/files/Collections/Alt.Sex.Stories.Moderated/Year2007/%i" % i
ofh.close()
except Error, err:
mylog.error(err.message)
return 1
except Usage, err:
mylog.error(err.message)
mylog.error("for help use --help")
return 2
if __name__ == '__main__':
sys.exit(main())