A simple news aggregator web app built as a college project. It fetches real-time technology and startup news using the NewsAPI and displays them as clean, responsive cards.
##Features
- Live News Feed β Fetches latest tech and startup news using NewsAPI
- Category Filters β Filter news by AI, Crypto, Gadgets, or view All
- Search β Instantly search through loaded articles by title or description
- Read More β Click any article link to open the full story in a new tab
- Image Fallback β Broken images are replaced with a placeholder automatically
- Responsive Layout β Cards wrap cleanly on all screen sizes
| Technology | Usage |
|---|---|
| HTML | Page structure |
| CSS | Styling and layout |
| JavaScript | Logic, DOM manipulation, API calls |
| NewsAPI | Public news data source |
Tech-News/
βββ index.html # Main HTML file
βββ index.css # Stylesheet
βββ index.js # JavaScript logic
βββ README.md # Project documentation
- On page load,
fetch()calls the NewsAPI with the querytechnology OR startup - The response JSON is stored in
allArticlesarray forEachloop creates a card for each article and appends it to#main- Filter buttons update the displayed cards by filtering
allArticlesusing.filter() - Search input filters articles in real time by matching title and description
NewsAPI β https://newsapi.org
- Endpoint:
GET /v2/everything - Parameters used:
q,sortBy,language,apiKey
Note: The free tier of NewsAPI only works on localhost for development. For production deployment, a paid plan is required.
- Clone or download this repository
- Open
index.htmldirectly in your browser, or use a local server like VS Code Live Server - News will load automatically on page open
fetch()and Promises (.then())forEachloop for DOM renderingfilter()for category and search filteringcreateElementandinnerHTMLfor dynamic card creationlocalStorage(for upcoming Night Mode feature)- CSS Flexbox for card layout
onerrorattribute for image fallback