Spaces:
Running
Running
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
# === Sample Data ===
|
4 |
+
news_mentions = [
|
5 |
+
{
|
6 |
+
"source": "One America News Network",
|
7 |
+
"title": "Victor Davis Hanson on the 2024 Election Landscape",
|
8 |
+
"link": "https://example.com/vdh-oann-election "
|
9 |
+
},
|
10 |
+
{
|
11 |
+
"source": "National Review",
|
12 |
+
"title": "The Decline of Civic Identity in Modern America",
|
13 |
+
"link": "https://example.com/vdh-nr-article "
|
14 |
+
},
|
15 |
+
{
|
16 |
+
"source": "Fox News",
|
17 |
+
"title": "Hanson Warns About Cultural Erosion",
|
18 |
+
"link": "https://example.com/vdh-fox-interview "
|
19 |
+
}
|
20 |
+
]
|
21 |
+
|
22 |
+
tv_appearances = [
|
23 |
+
{
|
24 |
+
"show": "OANN Live Interview",
|
25 |
+
"date": "April 5, 2024",
|
26 |
+
"link": "https://example.com/vdh-oann-appearance1 "
|
27 |
+
},
|
28 |
+
{
|
29 |
+
"show": "Political Roundtable Discussion",
|
30 |
+
"date": "March 28, 2024",
|
31 |
+
"link": "https://example.com/vdh-oann-appearance2 "
|
32 |
+
}
|
33 |
+
]
|
34 |
+
|
35 |
+
books = [
|
36 |
+
{
|
37 |
+
"title": "The Dying Citizen: How Progressive Elites, Tribalism, and Globalization Are Destroying the Idea of America",
|
38 |
+
"link": "https://www.amazon.com/Dying-Citizen-Progressive-Globalization-Destroying-ebook/dp/B08W4ZZTTP?r"
|
39 |
+
},
|
40 |
+
{
|
41 |
+
"title": "The Second World Wars: How the First Global Conflict Was Fought and Won",
|
42 |
+
"link": " https://www.amazon.com/Second-World-Wars-Global-Conflict-ebook/dp/B01N808V2J "
|
43 |
+
}
|
44 |
+
]
|
45 |
+
|
46 |
+
# === Helper Function (Flexible) ===
|
47 |
+
def display_links(data, title_key="title", link_key="link"):
|
48 |
+
return "\n".join([f"- [{item[title_key]}]({item[link_key]})" for item in data])
|
49 |
+
|
50 |
+
# === Gradio Interface ===
|
51 |
+
with gr.Blocks(theme="soft") as demo:
|
52 |
+
gr.Markdown(
|
53 |
+
"""
|
54 |
+
# Doctor Victor Davis Hanson News & Publications Aggregator
|
55 |
+
|
56 |
+
This app aggregates publicly available mentions and publications related to **Dr. Victor Davis Hanson**,
|
57 |
+
a public academic figure known for their commentary on politics and policy. The purpose of this tool is to provide
|
58 |
+
a centralized resource for tracking appearances, articles, interviews, and published works β intended for research,
|
59 |
+
media monitoring, and academic study.
|
60 |
+
|
61 |
+
> π *Note: This model does not express opinions, endorse views, or verify accuracy. Users are encouraged to consult original sources for context.*
|
62 |
+
"""
|
63 |
+
)
|
64 |
+
|
65 |
+
with gr.Tab("News Mentions"):
|
66 |
+
gr.Markdown(display_links(news_mentions))
|
67 |
+
|
68 |
+
with gr.Tab("TV Appearances"):
|
69 |
+
gr.Markdown(display_links(tv_appearances, title_key="show"))
|
70 |
+
|
71 |
+
with gr.Tab("Books"):
|
72 |
+
gr.Markdown("## π Books by Dr. Victor Davis Hanson\n")
|
73 |
+
gr.Markdown(display_links(books))
|
74 |
+
gr.Markdown(
|
75 |
+
"> π These links open directly to Amazon product pages. No user data is collected via these links."
|
76 |
+
)
|
77 |
+
|
78 |
+
gr.Markdown(
|
79 |
+
"""
|
80 |
+
## βοΈ Legal & Ethical Notice
|
81 |
+
|
82 |
+
- **Fair Use**: Quoted headlines and excerpts fall under U.S. fair use doctrine for purposes of research, criticism, and news reporting.
|
83 |
+
- **GDPR Compliance**: This app does not collect personal data about users or store unnecessary personal information about the subject.
|
84 |
+
- **Right to Be Forgotten**: If the individual or any third party requests removal of content or data, please use the Contact tab.
|
85 |
+
- **No Affiliate Marketing**: We do not use Amazon affiliate links or earn revenue from book referrals.
|
86 |
+
"""
|
87 |
+
)
|
88 |
+
|
89 |
+
# Launch the app
|
90 |
+
demo.launch()
|