A small program that lets you read news through the command line.
- Python 3.3 or higher
- pyperclip
- termcolor
- newspaper3k
These requirements can be installed together by running
pip install -r requirements.txt
or
pip3 install -r requirements.txt
depending on your system. As stated above, this program requires Python 3.3 or greater.
First, clone the repository:
git clone https://github.com/jbonatakis/news-desk.git
Then, register and get a (free) API key from: https://newsapi.org/
Run the program:
python3 news_desk.py
This will prompt you to enter your API key, which will be saved in a file named key
located in the ~/.nd_config/
directory and read to validate your access to the API each time News Desk is run.
-
News Desk grabs top headlines from all major U.S. news outlets
-
To view an article, type the article number and press
Enter
. This will print out the article text on the command line. -
Type
r
orrefresh
to update the list of articles. This command is not case sensitive. -
To exit the program and return to your command line, type
e
,exit
,q
, orquit
. Again, this is not case sensitive. -
If you run the program with the flag
-b
, then selecting an article will open it in the browser and copy the article URL to your clipboard.
If you would like to contribute to the project, feel free to open a pull request and I will review it as soon as possible.
- Open articles in browser with
-b
flag - Copy URL to clipboard when opening article in browser
- Show article text on command line by default
- Add search functionality
- Incorporate SMMRY API
- Allow user to specify number of articles to display
- Automatically encrypt API key while stored and decrypt before use