1
0
Fork 0

Add link to source code

Signed-off-by: Skylar "The Cobra" Widulski <cobra@vern.cc>
This commit is contained in:
Skylar "The Cobra" Widulski 2023-08-04 19:04:43 -04:00
parent e8b93beb87
commit ffb4e6efae
Signed by untrusted user: cobra
GPG Key ID: 4FD8F812083FF6F9
2 changed files with 15 additions and 9 deletions

View File

@ -12,7 +12,10 @@ def scrape(url):
our_path = re.sub(r".*://.*/", "/", request.url) our_path = re.sub(r".*://.*/", "/", request.url)
path = re.sub(r".*://.*/", "/", data.url) path = re.sub(r".*://.*/", "/", data.url)
print(our_path, path) print()
print(our_path)
print(path)
print()
if our_path != path: if our_path != path:
return f"REDIRECT {path}" return f"REDIRECT {path}"
ret = [] ret = []

View File

@ -10,11 +10,11 @@
<body> <body>
<center> <center>
<a href="/"> <a href="/">
<img src="{{ url_for('static', filename='img/logo.png') }}"> <img src="{{ url_for('static', filename='img/logo.png') }}">
</a> </a>
<form id="search" role="search" method="get" action="/define.php"> <form id="search" role="search" method="get" action="/define.php">
<input type="search" id="term" name="term" placeholder="Search" autofocus> <input type="search" id="term" name="term" placeholder="Search" autofocus>
<button>Go</button> <button>Go</button>
</form> </form>
<a href=/random.php>Random</a> <a href=/random.php>Random</a>
</center> </center>
@ -22,15 +22,18 @@
{% for defid, word, definition, example, author in data[0] %} {% for defid, word, definition, example, author in data[0] %}
<div class="{{ defid }}"> <div class="{{ defid }}">
<a href="/define.php?term={{ word }}"> <a href="/define.php?term={{ word }}">
<h2>{{ word }}</h2> <h2>{{ word }}</h2>
</a> </a>
<p>{{ definition|safe }}</p> <p>{{ definition|safe }}</p>
<p><i>{{ example|safe }}</i></p> <p><i>{{ example|safe }}</i></p>
<p>{{ author|safe }}</p> <p>{{ author|safe }}</p>
</div> </div>
<br> <br>
{% endfor %} {% endfor %}
{{ data[1]|safe }} {{ data[1]|safe }}
<center>
<p><a href="http://git.vern.cc/cobra/rural-dict">Source Code</a></p>
</center>
</body> </body>
</html> </html>