import gradio as gr import requests from bs4 import BeautifulSoup def gerar_artigo(url): try: html = requests.get(url).text soup = BeautifulSoup(html, "html.parser") texto = soup.get_text() artigo = f""" SEO Article Generated Source URL: {url} Summary of Content: {texto[:2000]} Suggested SEO Structure Title: Optimized Article Based on Source H2 Introduction Rewrite the introduction based on the extracted content. H2 Main Topic Explain the main ideas of the article. H2 Additional Insights Add more value and explanations. H2 Conclusion Summarize the topic and include final thoughts. """ return artigo except: return "Error reading URL" interface = gr.Interface( fn=gerar_artigo, inputs="text", outputs="text", title="URL to SEO Article Generator", description="Paste a URL and generate a new article structure." ) interface.launch()