Add link and functionality to bbs
This commit is contained in:
parent
fc42e62ceb
commit
ed98e328cd
2
app.py
2
app.py
@ -20,4 +20,4 @@ def privacypolicy():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app.run(host="0.0.0.0")
|
app.run(host="127.0.0.1")
|
||||||
|
21
helper.py
21
helper.py
@ -1,9 +1,28 @@
|
|||||||
|
import requests as python_requests
|
||||||
|
|
||||||
|
discussionPrefix = "https://talk.zhdo.space/topic/"
|
||||||
|
|
||||||
|
|
||||||
def getRecentArticle():
|
def getRecentArticle():
|
||||||
# TODO fetch latest article
|
# TODO fetch latest article
|
||||||
recent = {"title": "N/A", "link": "#"}
|
recent = {"title": "N/A", "link": "#"}
|
||||||
return recent
|
return recent
|
||||||
|
|
||||||
|
|
||||||
def getRecentDiscussion():
|
def getRecentDiscussion():
|
||||||
# TODO fetch latest discussion
|
|
||||||
recent = {"title": "N/A", "link": "#"}
|
recent = {"title": "N/A", "link": "#"}
|
||||||
|
obj = python_requests.get("https://talk.zhdo.space/api/recent/posts/week")
|
||||||
|
if obj.status_code == 200:
|
||||||
|
recent["title"] = str(obj.json()[0]["topic"]["title"])
|
||||||
|
recent["link"] = discussionPrefix + str(obj.json()[0]["topic"]["slug"])
|
||||||
return recent
|
return recent
|
||||||
|
else:
|
||||||
|
return "error"
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
print(getRecentDiscussion())
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
<div class="container-fluid py-5">
|
<div class="container-fluid py-5">
|
||||||
<h1 class="display-5 fw-bold">智互奥运</h1>
|
<h1 class="display-5 fw-bold">智互奥运</h1>
|
||||||
<p class="col-md-8 fs-4">
|
<p class="col-md-8 fs-4">
|
||||||
Using a series of utilities, you can create this jumbotron, just like
|
Elit est id esse iste impedit odit adipisci? Ea quia perspiciatis eos
|
||||||
the one in previous versions of Bootstrap. Check out the examples
|
adipisci aut numquam Veniam expedita repellendus temporibus voluptatem
|
||||||
below for how you can remix and restyle it to your liking.
|
nam aperiam Nemo doloremque ex at non deserunt. Blanditiis repellat
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -15,15 +15,15 @@
|
|||||||
<div class="row align-items-md-stretch">
|
<div class="row align-items-md-stretch">
|
||||||
<div class="col-md-6 mb-4">
|
<div class="col-md-6 mb-4">
|
||||||
<div class="h-100 p-5 text-white bg-darkblue rounded-3">
|
<div class="h-100 p-5 text-white bg-darkblue rounded-3">
|
||||||
<h2>奥运文化</h2>
|
<h2>体育文化</h2>
|
||||||
<p>
|
<p>
|
||||||
Sports Culture即体育文化,
|
Sports Culture即体育文化,
|
||||||
该公众号主要是为大学生提供一个有关体育文化的有趣的中英文知识学习及互动平台,
|
公众号主要是为大学生提供一个有关体育文化的有趣的中英文知识学习及互动平台,
|
||||||
让大家在了解体育知识与文化的同时学习到英语知识。
|
让大家在了解体育知识与文化的同时学习到英语知识。
|
||||||
</p>
|
</p>
|
||||||
<h6 class="mb-3">
|
<h6 class="mb-3">
|
||||||
<u>
|
|
||||||
最新文章:
|
最新文章:
|
||||||
|
<u>
|
||||||
<a href="{{ recentArticle['link'] }}"
|
<a href="{{ recentArticle['link'] }}"
|
||||||
>{{ recentArticle['title'] }}</a
|
>{{ recentArticle['title'] }}</a
|
||||||
>
|
>
|
||||||
@ -38,22 +38,24 @@
|
|||||||
<div class="h-100 p-5 bg-lightblue border rounded-3">
|
<div class="h-100 p-5 bg-lightblue border rounded-3">
|
||||||
<h2>奥运交流</h2>
|
<h2>奥运交流</h2>
|
||||||
<p>
|
<p>
|
||||||
Or, keep it light and add a border for some added definition to the
|
Adipisicing veniam repudiandae molestias molestiae sint Sit deserunt
|
||||||
boundaries of your content. Be sure to look under the hood at the
|
blanditiis sit ut distinctio doloribus. Modi sit est pariatur enim
|
||||||
source HTML here as we've adjusted the alignment and sizing of both
|
labore officiis quo At eligendi accusamus aspernatur corrupti animi
|
||||||
column's content for equal-height.
|
voluptas libero! Porro
|
||||||
</p>
|
</p>
|
||||||
<h6 class="mb-3">
|
<h6 class="mb-3">
|
||||||
<u>
|
|
||||||
最新讨论:
|
最新讨论:
|
||||||
|
<u>
|
||||||
<a href="{{ recentDiscussion['link'] }}"
|
<a href="{{ recentDiscussion['link'] }}"
|
||||||
>{{ recentDiscussion['title'] }}</a
|
>{{ recentDiscussion['title'] }}</a
|
||||||
>
|
>
|
||||||
</u>
|
</u>
|
||||||
</h6>
|
</h6>
|
||||||
|
<a href="https://talk.zhdo.space/">
|
||||||
<button class="btn btn-outline-secondary" type="button">
|
<button class="btn btn-outline-secondary" type="button">
|
||||||
跳转至讨论区
|
跳转至讨论区
|
||||||
</button>
|
</button>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user