ajsbsd commited on
Commit
f88f811
·
verified ·
1 Parent(s): 4388747

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +97 -0
app.py ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ # === Sample Data ===
4
+ tv_appearances = [
5
+ {
6
+ "source": "The Daily Signal",
7
+ "title": "Victor Davis Hanson: The Trump Deranged “Experts” Were Wrong. Again.",
8
+ "link": "https://www.youtube.com/live/WPSiYIl8ZLg "
9
+ },
10
+ {
11
+ "source": "The Daily Signal",
12
+ "title": "Victor Davis Hanson: 128 Democrats Reject Latest Trump Impeachment—Here’s The Major Reason Why",
13
+ "link": "https://www.youtube.com/watch?v=uQzoMjEd3G8"
14
+ },
15
+ {
16
+ "source": "Fox News",
17
+ "title": "Buttigieg is even worse than Biden: Victor Davis Hanson",
18
+ "link": " https://www.youtube.com/watch?v=9iIjdYZyUy0"
19
+ }
20
+ ]
21
+
22
+ news_mentions = [
23
+ {
24
+ "show": "Las Vegas Review Journal - VICTOR DAVIS HANSON: In the end, everyone hated the Iranian theocracy",
25
+ "date": "June 28, 2025 - 9:01 pm",
26
+ "link": " https://www.reviewjournal.com/opinion/opinion-columns/victor-davis-hanson/victor-davis-hanson-in-the-end-everyone-hated-the-iranian-theocracy-3390658/ "
27
+ }
28
+ ]
29
+
30
+ books = [
31
+ {
32
+ "title": "The Dying Citizen: How Progressive Elites, Tribalism, and Globalization Are Destroying the Idea of America",
33
+ "link": "https://www.amazon.com/Dying-Citizen-Progressive-Globalization-Destroying-ebook/dp/B08W4ZZTTP "
34
+ },
35
+ {
36
+ "title": "The Second World Wars: How the First Global Conflict Was Fought and Won",
37
+ "link": "https://www.amazon.com/Second-World-Wars-Global-Conflict-ebook/dp/B01N808V2J "
38
+ }
39
+ ]
40
+
41
+ # === Helper Function (Flexible & Robust) ===
42
+ def display_links(data, title_key="title", link_key="link", source_key=None, date_key=None):
43
+ lines = []
44
+ for item in data:
45
+ title = item.get(title_key, "[Untitled]")
46
+ link = item.get(link_key, "#")
47
+ source = item.get(source_key, "") if source_key else ""
48
+ date = item.get(date_key, "") if date_key else ""
49
+
50
+ full_title = f"{source}: {title}" if source else title
51
+ if date:
52
+ full_title += f" — {date}"
53
+
54
+ lines.append(f"- [{full_title}]({link.strip()})")
55
+ return "\n".join(lines)
56
+
57
+ # === Gradio Interface ===
58
+ with gr.Blocks(theme="soft") as demo:
59
+ gr.Markdown(
60
+ """
61
+ # Doctor Victor Davis Hanson News & Publications Aggregator
62
+
63
+ This app aggregates publicly available mentions and publications related to **Dr. Victor Davis Hanson**,
64
+ a public academic figure known for their commentary on politics and policy. The purpose of this tool is to provide
65
+ a centralized resource for tracking appearances, articles, interviews, and published works — intended for research,
66
+ media monitoring, and academic study.
67
+
68
+ > 🔍 *Note: This model does not express opinions, endorse views, or verify accuracy. Users are encouraged to consult original sources for context.*
69
+ """
70
+ )
71
+
72
+ with gr.Tab("News Mentions"):
73
+ gr.Markdown(display_links(news_mentions, title_key="show", link_key="link", date_key="date"))
74
+
75
+ with gr.Tab("TV Appearances"):
76
+ gr.Markdown(display_links(tv_appearances, source_key="source"))
77
+
78
+ with gr.Tab("Books"):
79
+ gr.Markdown("## 📚 Books by Dr. Victor Davis Hanson\n")
80
+ gr.Markdown(display_links(books))
81
+ gr.Markdown(
82
+ "> 📘 These links open directly to Amazon product pages. No user data is collected via these links."
83
+ )
84
+
85
+ gr.Markdown(
86
+ """
87
+ ## ⚖️ Legal & Ethical Notice
88
+
89
+ - **Fair Use**: Quoted headlines and excerpts fall under U.S. fair use doctrine for purposes of research, criticism, and news reporting.
90
+ - **GDPR Compliance**: This app does not collect personal data about users or store unnecessary personal information about the subject.
91
+ - **Right to Be Forgotten**: If the individual or any third party requests removal of content or data, please use the Contact tab.
92
+ - **No Affiliate Marketing**: I do not have an Amazon account, link to the main author.
93
+ """
94
+ )
95
+
96
+ # Launch the app
97
+ demo.launch()