ajsbsd's picture
Update app.py
517cb46 verified
import gradio as gr
# === Sample Data ===
tv_appearances = [
{
"source": "UN Human Rights Council",
"title": "Francesca Albanese urges businesses to end Israel ties to stop economy of genocide",
"link": "https://www.youtube.com/watch?v=ror1MKHSAQs"
},
{
"source": "UN Human Rights Council",
"title": "Q&A: Francesca Albanese, Special Rapporteur on the occupied Palestinian territories",
"link": "https://www.youtube.com/watch?v=tLa4BT0J8Q4"
},
{
"source": "UN Human Rights Council",
"title": "Francesca Albanese's closing statement at the 59th session of the UN Human Rights Council",
"link": "https://www.youtube.com/watch?v=-Nj3QcT2RjU"
},
{
"source": "Al Jazeera",
"title": "UN expert Albanese rejects ‘obscene’ US sanctions for criticising Israel",
"link": "https://www.aljazeera.com/news/2025/7/10/un-expert-albanese-rejects-obscene-us-sanctions-for-criticising-israel"
}
]
news_mentions = [
{
"show": "‘The Entire Human Rights System Is in Danger’ - Novara Media",
"date": "22 January 2025",
"link": "https://novaramedia.com/2025/01/22/the-entire-human-rights-system-is-in-danger-in-conversation-with-francesca-albanese/"
},
{
"show": "USA: Sanctions against UN Special Rapporteur Francesca Albanese are a disgraceful affront to international justice",
"date": "9 July 2025",
"link": "https://www.amnesty.org/en/latest/news/2025/07/usa-sanctions-against-un-special-rapporteur-francesca-albanese-are-a-disgraceful-affront-to-international-justice/"
},
{
"show": "UN Gaza investigator Francesca Albanese says US sanctions against her a sign of guilt",
"date": "10 July 2025",
"link": "https://www.theguardian.com/world/2025/jul/11/francesca-albanese-un-gaza-investigator-us-sanctions-guilt"
},
{
"show": "EU deeply regrets U.S. sanctions on UN expert on Palestinians, says EU spokesperson",
"date": "11 July 2025",
"link": "https://www.reuters.com/world/middle-east/eu-deeply-regrets-us-sanctions-un-expert-palestinians-says-eu-spokesperson-2025-07-11/"
},
{
"show": "U.N. Special Rapporteur Francesca Albanese on Israel : From Economy of Occupation to Economy of Genocide",
"date": "11 July 2025",
"link": "https://www.democracynow.org/2025/7/11/un_special_rapporteur_francesca_albanese_on"
},
{
"show": "Chris Hedges: The Persecution of Francesca Albanese",
"date": "15 July 2025",
"link": "https://www.youtube.com/watch?v=zW8zhrORPAM"
}
]
books = [
{
"title": "Quando il mondo dorme: Storie, parole e ferite della Palestina* (Italian Edition)",
"link": "https://www.amazon.com/Quando-mondo-dorme-Palestina-Italian-ebook/dp/B0F7LQYF6B"
},
{
"title": "Palestinian Refugees in International Law* 2nd Edition (Kindle Edition)",
"link": "https://www.amazon.com/Palestinian-Refugees-International-Francesca-Albanese-ebook/dp/B0851PKYFT"
}
]
# === Helper Function (Flexible & Robust) ===
def display_links(data, title_key="title", link_key="link", source_key=None, date_key=None):
lines = []
for item in data:
title = item.get(title_key, "[Untitled]")
link = item.get(link_key, "#")
source = item.get(source_key, "") if source_key else ""
date = item.get(date_key, "") if date_key else ""
full_title = f"{source}: {title}" if source else title
if date:
full_title += f" — {date}"
lines.append(f"- [{full_title}]({link.strip()})")
return "\n".join(lines)
# === Gradio Interface ===
with gr.Blocks(theme="soft") as demo:
gr.Image("https://ajsbsd.net/640pxUN_Special_Rapporteur_Francesca_Albanese.png")
gr.Markdown(
"""
# Dr. Francesca Albanese News & Publications Aggregator
This app aggregates publicly available mentions and publications related to **Dr. Francesca Albanese**,
a public academic figure known for their commentary on politics and policy. The purpose of this tool is to provide
a centralized resource for tracking appearances, articles, interviews, and published works — intended for research,
media monitoring, and academic study.
> 🔍 *Note: This model does not express opinions, endorse views, or verify accuracy. Users are encouraged to consult original sources for context.*
"""
)
with gr.Tab("News Mentions"):
gr.Markdown(display_links(news_mentions, title_key="show", link_key="link", date_key="date"))
with gr.Tab("TV Appearances"):
gr.Markdown(display_links(tv_appearances, source_key="source"))
with gr.Tab("Books"):
gr.Markdown("## 📚 Books by Dr. Francesca Albanese\n")
gr.Markdown(display_links(books))
gr.Markdown(
"> 📘 These links open directly to Amazon product pages. No user data is collected via these links."
)
gr.Markdown(
"""
## ⚖️ Legal & Ethical Notice
- **Fair Use**: Quoted headlines and excerpts fall under U.S. fair use doctrine for purposes of research, criticism, and news reporting.
- **GDPR Compliance**: This app does not collect personal data about users or store unnecessary personal information about the subject.
- **Right to Be Forgotten**: If the individual or any third party requests removal of content or data, please use the Contact tab.
- **No Affiliate Marketing**: I do not have an Amazon account, link to the main author.
"""
)
# Launch the app
demo.launch()