|
|
@ -1,5 +1,3 @@ |
|
|
|
import requests |
|
|
|
from lxml import html |
|
|
|
from flask import current_app, Blueprint, render_template, url_for, redirect |
|
|
|
|
|
|
|
|
|
|
@ -17,15 +15,15 @@ def handbook(): |
|
|
|
def worldmap(): |
|
|
|
return render_template('worldmap.html') |
|
|
|
|
|
|
|
@default_views.route('/treasure') |
|
|
|
@default_views.route('/treasure/<string:treasure_type>') |
|
|
|
#@default_views.route('/treasure') |
|
|
|
#@default_views.route('/treasure/<string:treasure_type>') |
|
|
|
def treasure(treasure_type=None): |
|
|
|
# import requests |
|
|
|
# from lxml import html |
|
|
|
# Unused, we can't tap into Autarch's generator, so just link to a new tab |
|
|
|
# in navigation bar now |
|
|
|
''' |
|
|
|
if treasure_type is not None: |
|
|
|
with requests.Session() as s: |
|
|
|
import pudb;pu.db |
|
|
|
# First grab the page to pull a fresh form_build_id |
|
|
|
treasure_page = s.get('http://autarch.co/treasure') |
|
|
|
dom_tree = html.fromstring(treasure_page.content) |
|
|
@ -42,5 +40,4 @@ def treasure(treasure_type=None): |
|
|
|
print("TG Response: {}, Payload: {}".format(response.text, payload)) |
|
|
|
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') |