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)