dbprojects.remove({}) # clear existing db collection visitedProjects = {} users = [] for user in dbusers.find(): users.append(user) numUser = 0 numProj = 0 for user in users: numUser = numUser + 1 print "Retrieving projects from user id: ", user["user_id"], " (", numUser, ")" while True: try: u = User(user["user_id"], user["auth_key"]) break except TooManyRequests as e: print "Maximum Request Reached! Wating for Next Hour..." time.sleep(60) # retry after 1 min continue except BehanceException as e: print "BehanceException: ", str(e) break pageNum = 1 while True: try: projects = u.get_projects(page=pageNum) if len(projects)==0: break
visitedProjects = {} users = [] for user in dbusers.find(): users.append(user) numUser = 0 numProj = 0 for user in users: numUser = numUser + 1 print "Retrieving projects from user id: ", user[ "user_id"], " (", numUser, ")" while True: try: u = User(user["user_id"], user["auth_key"]) break except TooManyRequests as e: print "Maximum Request Reached! Wating for Next Hour..." time.sleep(60) # retry after 1 min continue except BehanceException as e: print "BehanceException: ", str(e) break pageNum = 1 while True: try: projects = u.get_projects(page=pageNum) if len(projects) == 0: break
def get_user(self, user_id): return User(user_id, self.auth_key)
dbcollection.remove({}) # clear existing db collection visitedCols = {} users = [] for user in dbusers.find(): users.append(user) numUser = 0 numCols = 0 for user in users: numUser = numUser + 1 print "Retrieving cols from user id: ", user["user_id"], " (", numUser, ")" while True: try: u = User(user["user_id"], user["auth_key"]) break except TooManyRequests as e: print "Maximum Request Reached! Wating for Next Hour..." time.sleep(60) # retry after 1 min continue except BehanceException as e: print "BehanceException: ", str(e) break pageNum = 1 while True: try: cols = u.get_collections(page=pageNum) if len(cols)==0: break;
dbappreciations.remove({}) # clear existing db collection visitedProjects = {} users = [] for user in dbusers.find(): users.append(user) numUser = 0 numAppreciations = 0 for user in users: numUser = numUser + 1 print "Retrieving appreciations from user id: ", user["user_id"], " (", numUser, ")" while True: try: u = User(user["user_id"], user["auth_key"]) break except TooManyRequests as e: print "Maximum Request Reached! Wating for Next Hour..." time.sleep(60) # retry after 1 min continue except BehanceException as e: print "BehanceException: ", str(e) break pageNum = 1 while True: try: appreciations = u.get_appreciations(page=pageNum) if len(appreciations)==0:
dbcollection.remove({}) # clear existing db collection visitedCols = {} users = [] for user in dbusers.find(): users.append(user) numUser = 0 numCols = 0 for user in users: numUser = numUser + 1 print "Retrieving cols from user id: ", user["user_id"], " (", numUser, ")" while True: try: u = User(user["user_id"], user["auth_key"]) break except TooManyRequests as e: print "Maximum Request Reached! Wating for Next Hour..." time.sleep(60) # retry after 1 min continue except BehanceException as e: print "BehanceException: ", str(e) break pageNum = 1 while True: try: cols = u.get_collections(page=pageNum) if len(cols) == 0: break
visitedProjects = {} users = [] for user in dbusers.find(): users.append(user) numUser = 0 numAppreciations = 0 for user in users: numUser = numUser + 1 print "Retrieving appreciations from user id: ", user[ "user_id"], " (", numUser, ")" while True: try: u = User(user["user_id"], user["auth_key"]) break except TooManyRequests as e: print "Maximum Request Reached! Wating for Next Hour..." time.sleep(60) # retry after 1 min continue except BehanceException as e: print "BehanceException: ", str(e) break pageNum = 1 while True: try: appreciations = u.get_appreciations(page=pageNum) if len(appreciations) == 0: