A Python-based CLI app that delivers real-time news from around the world on any topic, anytime, anywhere — powered by NewsAPI.
- Fetches real-time news articles for a given topic
- Displays the title, description, and link for each article
- User-specified number of articles to fetch
- Clean and interactive CLI interface
- Python 3.x
requestslibrary- A free API key from NewsAPI
-
Clone the repository:
git clone https://github.com/your-username/anytime-anywhere-any-news.git cd anytime-anywhere-any-news -
Install dependencies:
pip install requests
-
Set up your API key:
- Open the
config.pyfile. - Replace the value of
API_KEYwith your own NewsAPI key:API_KEY = "your_actual_api_key"
- Open the
-
Run the script:
python main.py
What type of news are you interested in reading today? science
How many articles do you want to see? 5The date is currently hardcoded in the request URL. You may modify this in main.py to use the current date dynamically.
anytime-anywhere-any-news/
│
├── main.py # Main script to fetch and display news
├── config.py # Stores the API key
└── README.md # Project documentation
This project is licensed under the MIT License.
- NewsAPI for providing the news data.