More steps, include link to search flickr
This commit is contained in:
parent
7934bacf20
commit
c77ae56ba0
3 changed files with 56 additions and 2 deletions
15
main.py
15
main.py
|
|
@ -12,9 +12,20 @@ enwiki = "en.wikipedia.org/wiki/"
|
|||
|
||||
|
||||
@app.route("/")
|
||||
def start_form() -> str:
|
||||
def start() -> str:
|
||||
"""Start form."""
|
||||
return flask.render_template("start_form.html")
|
||||
return flask.render_template("wikipedia_url.html")
|
||||
|
||||
|
||||
@app.route("/flickr")
|
||||
def flickr_search() -> str:
|
||||
"""Search flickr."""
|
||||
wikipedia_url = flask.request.args["wikipedia"]
|
||||
start = wikipedia_url.find(enwiki) + len(enwiki)
|
||||
name = unquote(wikipedia_url[start:]).replace("_", " ")
|
||||
return flask.render_template(
|
||||
"flickr_search.html", name=name, wikipedia_url=wikipedia_url
|
||||
)
|
||||
|
||||
|
||||
@app.route("/message")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue