You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

33 lines
1.3 KiB

import requests
from flask import current_app, Blueprint, render_template, url_for, redirect
default_views = Blueprint('default_views', __name__, url_prefix='/')
@default_views.route('/')
def index():
return redirect(url_for('npc_views.generate_npc_party'))
# return render_template('index.html')
@default_views.route('/handbook')
def handbook():
return render_template('handbook.html')
@default_views.route('/worldmap')
def worldmap():
return render_template('worldmap.html')
@default_views.route('/treasure')
@default_views.route('/treasure/<string:treasure_type>')
def treasure(treasure_type=None):
if treasure_type is not None:
headers = {'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'}
payload = {
"treasure_type": treasure_type,
"form_id": "acks_treasure_form",
"form_build_id": "form-PqO-1VglfW4Q3x1fm7HMewhLFjst2oxY5AR_m6WOGBg"
}
response = requests.request("POST", "http://autarch.co/system/ajax", data=payload, headers=headers)
generated_treasure = response.json()[1]["data"].replace('class="form-textarea"', 'class="uk-textarea"')
return render_template('treasure.html', generated_treasure=generated_treasure, treasure_type=treasure_type)
return render_template('treasure.html')