def on_register_error(self, response: SignUpError): if "captcha_url" in dir(response): print(response.captcha_url) result = input("Captcha result:") client.register(args.email, args.username, args.password, args.firstname, args.lastname, args.birthday, result) else: print("Unable to register! error information:\r\n{}".format(response)) def on_roster_received(self, response: FetchRosterResponse): print("Friends: {}".format(response.peers)) if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('username') parser.add_argument('email') parser.add_argument('-p', '--password') parser.add_argument('--firstname', default='Not A') parser.add_argument('--lastname', default='Human') parser.add_argument('--birthday', default='01-01-1990') args = parser.parse_args() if args.password is None: args.password = input('Password: ') logging.basicConfig(format=KikClient.log_format(), level=logging.DEBUG) client = KikClient(callback=RegisterClient(), kik_username=None, kik_password=None) client.register(args.email, args.username, args.password, args.firstname, args.lastname, args.birthday)
def on_authenticated(self): print("Authorized connection initiated.") client.request_roster() def on_login_ended(self, response: LoginResponse): print("Logged in as {}.".format(response.username)) def on_register_error(self, response: SignUpError): if "captcha_url" in dir(response): print(response.captcha_url) result = input("Captcha result:") client.register(email, username, password, first, last, birthday, result) else: print("Unable to register! error information:\r\n{}".format( response)) def on_roster_received(self, response: FetchRosterResponse): print("Friends: {}".format(response.members)) if __name__ == '__main__': username = input('Username: '******'Password: '******'First name: ') last = input('Last name: ') email = input('Email: ') birthday = input('Birthday: (like 01-01-1990): ') client = KikClient(callback=RegisterClient(), log_level=logging.DEBUG) client.register(email, username, password, first, last, birthday)