Spaces:
Sleeping
Sleeping
File size: 900 Bytes
42b5a1a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
import gradio as gr
from rss_reader import fetch_articles
from agent import analyze_article
from renderer import render_html
def process_rss(rss_input):
rss_urls = [url.strip() for url in rss_input.strip().splitlines() if url.strip()]
raw_articles = fetch_articles(rss_urls)
analyzed = [analyze_article(a['text'], a['title'], a['link']) for a in raw_articles]
return render_html(analyzed)
default_rss = """https://rss.nytimes.com/services/xml/rss/nyt/Technology.xml
https://www.reutersagency.com/feed/?best-sectors=technology"""
iface = gr.Interface(
fn=process_rss,
inputs=gr.Textbox(label="Enter RSS URLs (one per line)", value=default_rss, lines=4),
outputs=gr.HTML(label="📊 GenAI RSS Digest"),
title="GenAI RSS Summarizer",
description="Summarizes articles and detects what’s useful to analytics teams"
)
if __name__ == "__main__":
iface.launch()
|