InstantNews, get news instantly from the command line

Instant News about

In the next article we are going to take a look at InstantNews. In this digital age, there are a host of public applications and services available to read news online. Most of them show us the news using their corresponding GUI.

For those of us who live glued to a terminal all day, fortunately there is a command line utility for reading news. This utility gives us the possibility to instantly retrieve all kinds of news and shows them in the Terminal. We will not need any GUI application. According to its creator, we will also have the possibility of using the system's default browser to read the news of the World and view its images, although this is not entirely true.

In this short article we will see how install InstantNews on Ubuntu, although it is also available for other Unix-like operating systems.

Installing InstantNews

The installation of this utility I have done on Ubuntu 17.04, but I suppose that in other versions it will work the same way. To perform the installation, we can choose two equally simple ways. The InstantNews utility can install using pip o can be compiled and installed directly from the source.

Installation via PIP

To perform this InstantNews installation we will need to install PIP on Debian, Ubuntu, Linux Mint. We can do this by opening a terminal (Ctrl + Alt + T) and typing in it:

sudo apt-get install python-pip

Once PIP is installed, we can install InstantNews with the command in the same terminal:

pip install instantnews

Installation with source code

For compile from source, we will only have to open the terminal (Ctrl + Alt + T) and write the following commands one by one:

git clone https://github.com/shivam043/instantnews.git
cd instantnew
sudo python setup.py install

Configure InstantNews

Instantnews retrieves all News API news headlines. For those of you who don't know what that is, say the News API is a simple and easy-to-use API that returns the JSON metadata for headlines currently posted on a variety of blog and news sources.

Today offers live headlines from over 70 popular sources, such as: Ars Technica, BBC, Blooberg, CNN, Daily Mail, Engadget, ESPN, Financial Times, Google News, hacker News, IGN, Mashable, National Geographic, Reddit r / all, Reuters, Speigel Online, Techcrunch, The Guardian, The Hindu, The Huffington Post, The Newyork Times, The Next Web, The Wall street Journal and a few more.

To begin with, and before anything else, we will need a News API API key. To obtain it we will have to address the following URL and register. Registration is completely free, it only takes a few seconds so that we can obtain the API key we need.

newsapi account creation

Once we have the API key for the News API site, we will have to edit the .bashrc file from our home. To do this we write in the terminal:

vi ~/.bashrc

At the end of the file, we will have to add newsapi API key as below show:

export IN_API_KEY="PEGA AQUÍ LA CLAVE API DE NEWSAPI"

Let no one miss that we must paste the key inside the double quotes. Now we can save and close the file. Run the following command to update the changes.

source ~/.bashrc

Basic use of InstantNews

We can see the help by executing in the terminal:

instantnews options

instantnews -h

We can list all available news channels. We will see the list of all available news channels by typing the following in the terminal:

instantnews -sa

The sample output would be something like the following:

instantnews sources

As I already mentioned, there are approximately 70 news sources. As I have read, more will be added (if they were added in Spanish, that would be fine). As you can see from the output above, all the news sources are listed in a single output.

We can also show the categories of the news channels. To show the entire category of news channel codes, we will only have to execute:

instantnews --show_all

instantnews categories

For get news headlines from a channel, let's say cnn. We will only have to execute the following command:

instantnews --news cnn

Now, the terminal will show us all the news headlines from the given news source, that is, from CNN in our case.

instantnews cnn news

When testing it, I noticed that I can't open any of the news in my web browser to read more about it. So in this version, more than reading all the news, we can only read the extract. I guess it's a mistake. Of course, there is no code without errors. I hope that in future versions the developer will fix this problem and add some new features.

This project is still very young, but it is being actively developed. If you find any other bugs or have features that you would like to see implemented, you can notify the author on the page of GitHub of the project.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.