A modern, responsive news aggregator web application that fetches and displays news articles from various categories and allows users to search for specific topics.
- 📰 Browse news by categories (Business, Politics, Sports, Science, Health, Entertainment, Technology, General)
- 🔍 Search for news articles by keywords
- 📱 Responsive design that works on desktop and mobile
- ♾️ Infinite scroll for seamless browsing
- 🎨 Modern UI with hover effects and smooth transitions
- 🔗 Direct links to full articles
- 📅 Display publication dates and news sources
- HTML5 - Structure and semantic markup
- CSS3 - Styling with modern features (flexbox, transitions, hover effects)
- Vanilla JavaScript - Dynamic functionality and API integration
- NewsAPI - Real-time news data source
- GitHub Pages - Free hosting and deployment
- A modern web browser
- NewsAPI key (get one free at NewsAPI.org)
- Clone the repository:
git clone https://github.com/Theesamkos/News-Aggregator.git
cd News-Aggregator- Open
script.jsand replace the API key with your own:
const API_KEY = "your-newsapi-key-here";- Open
index.htmlin your web browser or serve it using a local server.
For local development, you can use any simple HTTP server:
# Using Python 3
python -m http.server 8000
# Using Node.js (if you have http-server installed)
npx http-server
# Using PHP
php -S localhost:8000Then visit http://localhost:8000 in your browser.
- Browse by Category: Select a news category from the dropdown and click "Fetch News"
- Search: Enter keywords in the search box and press Enter or click "Search"
- Infinite Scroll: Scroll down to automatically load more articles
- Read Full Articles: Click "Read More" on any article to view the full story
This app uses the NewsAPI service:
- Top Headlines:
/v2/top-headlines- For category-based news - Everything:
/v2/everything- For keyword searches
news-website/
├── index.html # Main HTML file
├── style.css # CSS styles
├── script.js # JavaScript functionality
└── README.md # Project documentation
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- NewsAPI for providing the news data
- Google Fonts for the Roboto and Poppins fonts
- Icons and inspiration from various design resources
Theesamkos - GitHub Profile
⭐ Star this repository if you found it helpful!