Sasa News App is a streamlined Streamlit application that allows users to search for news articles on any topic and optionally have them delivered directly to their email inbox. Built with simplicity and functionality in mind, this app leverages the NewsAPI to fetch current articles and presents them in an easy-to-read format.
- News Search π: Search for articles on any topic using the NewsAPI
- Clean Display π: View article titles, descriptions, URLs, and publication times in a well-formatted layout
- Email Delivery π§: Send the top 10 search results directly to your email
- User-Friendly Interface π₯οΈ: Simple two-tab design separating search and email functionality
The app is built using:
- Streamlit π: For the web interface and UI components
- NewsAPI π°: To fetch relevant news articles based on user queries
- SMTP π¨: For sending emails via Gmail
- SSL π: For secure email transmission
The codebase is organized into clear functions:
search_news(): Handles API requests to NewsAPIdisplay_news(): Formats and displays articles in the Streamlit interfaceformat_content(): Prepares article data for email deliverysend_news_to_email(): Manages the email sending process
The application uses Streamlit's secrets management to securely store:
- NewsAPI key
- Email credentials
This prevents sensitive information from being exposed in the codebase.
Users can:
- Enter a topic in the search tab to view current news articles
- Switch to the email tab to have articles on their chosen topic sent to their email address
- Receive a formatted email containing titles and links to the top 10 most recent articles
- Currently limited to the free tier of NewsAPI
- Email delivery is configured for Gmail only
- No persistent storage of user preferences or search history
This project serves as a practical example of combining web APIs, email functionality, and a clean user interface in a Streamlit application. π