A Python program to web scraping articles and podcasts titles from my favourite website The Conversation.
- Clone the repository:
git clone https://github.com/Lmanangka/theconversation-scraping.git
- Navigate to the directory:
cd theconversation-scraping
- Install the requirements:
pip install -r requirements.txt
-
This program use mpv player to open and play selected podcast:
- Debian/Ubuntu
sudo apt install mpv
- Fedora
sudo dnf install mpv
- Arch
sudo pacman -S mpv
- OpenSUSE
sudo zypper install mpv
- Download the Installation from the official website: https://mpv.io/installation/
Run the program by executing the following command:
python news.py -a
To display the podcasts titles, use the following command:
python news.py -p
The program will display a menu with the articles or podcasts titles based on your choice. You can navigate the menu using the up dan down arrow keys or the 'j' and 'k' keys.
To select an item from the menu, press 'Enter' or 'Return'. If you selected an article, the program will open the article in your default web browser. If you selected a podcasts, the program will play the selected podcast using mpv player. Here the keybinding for mpv player:
Key Binding | Function |
---|---|
Space | Pause/Play |
Left Arrow | Seek backward 5 seconds |
Right Arrow | Seek forward 5 seconds |
Up Arrow | Seek forward 60 seconds |
Down Arrow | Seek backward 60 seconds |
0 | Increase volume |
9 | Decrease volume |
M | Mute/unmute |
Q | Exit mpv |
You can also limit the number of items displayed in the menu by using the 'l' or '--limit' option. For example, to display only 5 items, use the use the following command:
python news.py -a -l 5