def activity_fakes(self): try: fakes = self.storage.get('priority_connection', 'fakes', default={}) if len(fakes) == 0: return while 1: name = random.choice(fakes.keys()) fake = fakes[name] try: browser = AuMBrowser(fake['username'], fake['password'], proxy=self.browser.proxy) except (AdopteBanned,BrowserIncorrectPassword), e: self.logger.warning('Fake %s can\'t login: %s' % (name, e)) continue profiles = browser.search_profiles(country="fr", dist='10', save=True) if not profiles: continue id = profiles.pop() profile = browser.get_profile(id) # bad rate for i in xrange(4): browser.rate(profile.get_id(), i, 0.6) # deblock browser.deblock(profile.get_id()) return except BrowserUnavailable: # don't care pass
def check_godchilds(self): with self.browser: try: my_id = self.browser.get_my_id() nb_godchilds = self.browser.nb_godchilds() except AdopteWait: nb_godchilds = 0 except BrowserUnavailable: # We'll check later return missing_godchilds = int(self.config['minimal']) - nb_godchilds self.logger.info('Missing godchilds: %s' % missing_godchilds) if missing_godchilds <= 0: return for i in xrange(missing_godchilds): registered = False while not registered: name = self.generate_name() password = self.generate_password() browser = AuMBrowser('%s@%s' % (name, self.config['domain']), proxy=self.browser.proxy) try: browser.register(password= password, sex= 1, #s**t birthday_d= random.randint(1,28), birthday_m= random.randint(1,12), birthday_y= random.randint(1975, 1990), zipcode= 75001, country= 'fr', godfather= my_id) except AccountRegisterError, e: self.logger.warning('Unable to register account: %s' % e) except CaptchaError: self.logger.warning('Unable to solve captcha... Retrying') else: registered = True # set nickname browser.set_nickname(name.strip('_').capitalize()) # rate my own profile with good score for i in xrange(4): browser.rate(my_id, i, 5.0) # save fake in storage fake = {'username': browser.username, 'password': password} self.storage.set('priority_connection', 'fakes', name, fake) self.storage.save() self.logger.info('Fake account "%s" created (godfather=%s)' % (name, my_id))