示例#1
0
def home():
    egg_filename = os.path.join(app.config['DINO_FOLDER'], 'Egg.png')
    form = FeedForm()
    if form.validate_on_submit():
        print("validated")
        return redirect('/eat', form.user_input)
    print("not validated")
    return render_template('home.html', form=form, egg_file=egg_filename)
示例#2
0
def eat():
    user_input = "EAT"
    hatchd_filename = os.path.join(app.config['DINO_FOLDER'], 'hatched1.png')
    background_file = os.path.join(app.config['BACKGROUND_FOLDER'], 'back1.jpg')
    poopimg = os.path.join(app.config['DINO_FOLDER'], 'poop.png')
    cred_path = os.path.join(app.config['CRED_PATH'], 'twt_creds.txt')
    form = FeedForm()
    if form.validate_on_submit():
        form_list = form.user_input.data.split(" ")
        generate_tweet(cred_path, form_list)
        return redirect('/fed1')
    return render_template('eat.html', form=form, uin=user_input, dino_file=hatchd_filename, poop=poopimg, background_image=background_file)
示例#3
0
def home():
    egg_filename = os.path.join(app.config['DINO_FOLDER'], 'egg.png')
    poopimg = os.path.join(app.config['DINO_FOLDER'], 'poop.png')
    background_file = os.path.join(app.config['BACKGROUND_FOLDER'], 'back1.jpg')
    cred_path = os.path.join(app.config['CRED_PATH'], 'twt_creds.txt')
    form = FeedForm()
    if form.validate_on_submit():
        form_list = form.user_input.data.split(" ")

        print("\n\n\n\n\n\n\n\n")
        print(form_list)

        generate_tweet(cred_path, form_list)
        return redirect('/eat')
    return render_template('home.html', form=form, dino_file=egg_filename, background_image=background_file)
示例#4
0
def fed():
    user_input = "FED"
    print(user_input)
    dino_filename = os.path.join(app.config['DINO_FOLDER'], 'dino.png')
    background_file = os.path.join(app.config['BACKGROUND_FOLDER'],
                                   'back1.jpg')
    poopimg = os.path.join(app.config['DINO_FOLDER'], 'poop.png')
    form = FeedForm()
    if form.validate_on_submit():
        print("validated")
        return redirect('/eat')
    print("not validated")
    return render_template('fed.html',
                           form=form,
                           uin=user_input,
                           dino_file=dino_filename,
                           poop=poopimg,
                           background_image=background_file)
示例#5
0
def eat():
    # e = requests.get('https://frontsend.azurewebsites.net/').content
    user_input = "EAT"
    print(user_input)
    hatchd_filename = os.path.join(app.config['DINO_FOLDER'], 'hatched1.png')
    background_file = os.path.join(app.config['BACKGROUND_FOLDER'],
                                   'back1.jpg')
    poopimg = os.path.join(app.config['DINO_FOLDER'], 'poop.png')
    form = FeedForm()
    if form.validate_on_submit():
        print("validated")
        return redirect('/fed')
    print("not validated")
    return render_template('eat.html',
                           form=form,
                           uin=user_input,
                           dino_file=hatchd_filename,
                           poop=poopimg,
                           background_image=background_file)