コード例 #1
0
            arguments.name, arguments.id))

        if (campaign.id_exists(arguments.id)):
            pp and print("[!] Campaign with same ID already exists")
            pp and print("[!] Failure")
            exit(1)

        # TODO: Check if same id exists

        if arguments.strategy_type == STRATEGY_TWEETS:
            pp and print("[+] Strategy set to 'User with most retweets first'")
            pp and print("[+] Fetching followers.....", end='')
            followers = chakraInstance.get_ranks_from_retweets(user_id)
            pp and print("fetched {} followers".format(len(followers)))
            campaign.create_new_campaign(arguments.id, arguments.name,
                                         arguments.strategy_type, followers,
                                         False, arguments.message)
            pp and print("[+] Success")
        elif arguments.strategy_type == STRATEGY_FOLLOWERS:
            pp and print(
                "[+] Strategy set to 'User with most followers first'")
            pp and print("[+] Fetching followers.....", end='')
            followers = chakraInstance.get_ranks_from_follower_followers(
                user_id)
            pp and print("fetched {} followers".format(len(followers)))
            campaign.create_new_campaign(arguments.id, arguments.name,
                                         arguments.strategy_type, followers,
                                         False, arguments.message)
            pp and print("[+] Success")
        elif arguments.strategy_type == STRATEGY_FRIENDS:
            pp and print("[+] Strategy set to 'User with most friends first'")