How to print out a list of all BBC news headlines with the command line. This is very cool.

This simple one-liner will print out all of the news headlines from the BBC news website in a simple text format. This is useful if you want to do something with a list like this. Or if you just want a listing to see if there is anything interesting happening.

[email protected]:~$ curl -s http://feeds.bbci.co.uk/news/rss.xml | grep "<title>" | sed "s/      <title>//g;s/<\/title>//;" | grep -v "BBC News"

Here is this one-liner in action.

[email protected]:~$ curl -s http://feeds.bbci.co.uk/news/rss.xml | grep "<title>" | sed "s/      <title>//g;s/<\/title>//;" | grep -v "BBC News"
National Living Wage comes into force  
Javid to visit Port Talbot steelworkers  
Tesla launches 'affordable' Model 3  
More obese than underweight, says study  
Police to hire extra firearms officers  
US and China to co-operate over N Korea  
Musician sues ROH over ruined hearing  
Stars turn out for Bowie tribute  
Brussels airport 'to partially reopen'

This is a very good way to get a listing of news items in your terminal. Very useful indeed.

2 responses to “How to print out a list of all BBC news headlines with the command line. This is very cool.

Very good script, but how do you get rid of the statical data at the top? I want top see just the beginning of the headline and the rest.
Thanks,
Don

Leave a Reply