return returnStr elif i == 3: returnStr = baseStr + "VeryHighSample.txt" return returnStr else: print "Error in bracketSwitcher" sys.exit() for i in range(1, 4): fileName = bracketSwitcher(i) fileObject = open(fileName, 'w') print fileName #Progression Tracking matches = d2slib.getMatches(hero=heroID, skill=i, dateMax=endingDate) start = int( matches[-1] ) - 1 #This is for setting the startID to something lower than the 25th entry of each getMatches call timer = endingDate #Used in the while loop to track what day we're on counter = 100 #Tracks how far we are into the 500 game per day sample totalcounter = 0 #Tracks how far we are into the total sample exceptioncounter = 0 while (totalcounter < sampleSize): while (counter < 500): try: morematches = d2slib.getMatches( hero=heroID, skill=i, startID=start, dateMax=timer ) #morematches is a temporary holder for each page
#!/usr/bin/python import d2slib #winxp's script import sys import cPickle #file input and output import collections #checks for duplicates import time #exception pausing for 503 errors fileName = "[6.80][VH][1.30]Sample.txt" #MODIFY MANUALLY for skill level and date fileObject = open(fileName,'w') matches = d2slib.getMatches(skill=3, dateMax=1391040000) #MODIFY MANUALLY for different skill levels; normal: skill=1, high: skill=2, veryhigh: skill=3 start = int(matches[-1]) - 1 timer = 1391040000 #January 30th 2014 12:00 AM UTC #We're getting the first 500 matches for every 6 hour window counter = 25 #This keeps track of how far you are into the 500 match loop #This is for setting the startID to something lower than the 25th entry of each getMatches call totalcounter = len(matches) #This determines when 10,000 matches have been grabbed exceptioncounter = 0 #used exclusively for exception shutdown while (totalcounter < 500): while (counter < 500): try: morematches = d2slib.getMatches(skill=3, startID=start, dateMax=timer) #MODIFY MANUALLY for different skill levels; normal: skill=1, high: skill=2, veryhigh: skill=3 matches.extend(morematches) #Adds the 25 matches grabbed each loop to the back of the entire match collection counter = counter + 100 #Basically adds 25 to counter unless something unexpected is going on in getMatches start = int(morematches[-1]) - 1 exceptioncounter = 0 #resets script shutdown counter except:
# high.extend(matches) # elif bracket == 3: # vhigh.extend(matches) for j in range(1, 113): print it + ` i ` + ', hero: ' + ` j ` if j == 24 or j == 108: pass else: for b in range(3, 4): for x in range(0, 5): complete = False exceptioncounter = 0 while complete == False: try: if x == 0: matches = d2slib.getMatches(hero=j, skill=b) if b == 2: high.extend(matches) high = sorted(set(high)) hStart = int(matches[-1]) - 1 if b == 3: vhigh.extend(matches) vhigh = sorted(set(vhigh)) vStart = int(matches[-1]) - 1 complete = True else: if b == 2: matches = d2slib.getMatches(hero=j, skill=b, startID=hStart) high.extend(matches)
#!/usr/bin/python import d2slib #winxp's script import sys import cPickle #file input and output import collections #checks for duplicates import time #exception pausing for 503 errors fileName = "[TreantProtector677]VeryHighSample.txt" #MODIFY MANUALLY for different skill levels fileObject = open(fileName, 'w') matches = d2slib.getMatches( hero=83, skill=3, dateMax=1362441600 ) #MODIFY MANUALLY for different skill levels; normal: skill=1, high: skill=2, veryhigh: skill=3 #hero=83 is Treant Protector. Figure out a way to automate this in the future using heroList2 start = int( matches[-1] ) - 1 #This is for setting the startID to something lower than the 25th entry of each getMatches call timer = 1362441600 #March 5th 2012 0:00 AM GMT #We're getting the first 500 matches for every 6 hour window counter = 25 #This keeps track of how far you are into the 500 match loop totalcounter = 0 #This is used to determine when a sufficient number of matches have been grabbed exceptioncounter = 0 #used exclusively for exception shutdown while (totalcounter < 5000): while (counter < 500): try: morematches = d2slib.getMatches( hero=83, skill=3, startID=start, dateMax=timer ) #MODIFY MANUALLY; morematches is a temporary holder for each page