def main():
    print('Welcome to the ScrapeBot setup')

    config = get_config()
    instance_name = check_minimal_config(config)

    print('Continuing to the database')
    print('- connecting to ' + config.get('Database', 'host', fallback='localhost'))
    try:
        engine = get_engine(config)
        base.metadata.create_all(engine)
        db = get_db(engine)
    except:
        print('- uh, there is a problem with connecting to your database ...')
        exit(3)
    print('- read tables: ' + ', '.join(base.metadata.tables.keys()))
    users = db.query(User).order_by(User.created).all()
    user = None
    if len(users) == 0:
        print('- the database currently does not contain any users, so we will create a default one')
        username = read_forcefully('- what name should this user listen to', 'root')
        email = read_forcefully('- and what is this user\'s email address')
        user = create_user(db, username, email)
    else:
        print('- one or many users available')
        user = db.query(User).filter(User.name == 'root').first()
        if user is None:
            user = users[0]

    while read_bool_forcefully('Do you want to create another user'):
        username = read_forcefully('- what name should this user listen to')
        email = read_forcefully('- and what is this user\'s email address')
        create_user(db, username, email)

    print('Checking this instance')
    this_instance = db.query(Instance).filter(Instance.name == instance_name)
    print('- it is called ' + instance_name)
    if this_instance.count() == 0:
        db.add(Instance(name=instance_name, owner_uid=user.uid))
        db.commit()
        print('- instance newly registered and ascribed to user "' + user.name + '"')
    else:
        print('- instance name already registered, meaning that it has been used elsewhere')
        if read_bool_forcefully('- is this on purpose'):
            print('- okay, fair enough, proceeding ...')
        else:
            instance_name = read_forcefully('- so how should this instance be called')
            config.add_value('Instance', 'Name', instance_name)
            config.write()
            print('- alright, updated "config.ini"')
            db.add(Instance(name=instance_name, owner_uid=user.uid))
            db.commit()
            print('- instance newly registered and ascribed to user "' + user.name + '"')
    print('- browser-wise this instance will use ' + config.get('Instance', 'browser', fallback='Firefox'))

    print('Finishing up')
    print('- instance should be ready to use')
    print('- to run it once, use the script "scrapebot.py"')
    if platform.system() == 'Linux':
        print('- to run it regularly and since you are using Linux, I recommend a cronjob')
        os_user = getpass.getuser()
        if read_bool_forcefully('- install cronjob for ' + os_user + ' now'):
            cron = CronTab(user=os_user)
            cron.remove_all(comment='ScrapeBot // ' + instance_name)
            cronjob = cron.new(command='cd ' + os.getcwd() + ' && ' + sys.executable +
                                       ' scrapebot.py >> scrapebot_cron.log',
                               comment='ScrapeBot // ' + instance_name)
            cronjob.minute.every(2)
            cron.write()
    else:
        print('- to run it regularly (which is what you want), you may want to use Windows Task Scheduler or the like')
    print('---------')
    print('Thanks for using; please direct any questions and pull requests to https://github.com/marhai/scrapebot')
    db.close()