Created
July 30, 2019 14:47
-
-
Save rbricheno/a799c2ba31c7669b2706c49e93b0300b to your computer and use it in GitHub Desktop.
BBC news in the terminal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -s http://feeds.bbci.co.uk/news/rss.xml?edition=uk | grep '<description>' | cut -f3 -d "[" | cut -f1 -d "]" |
And why not make it more readable, with awk?
curl -s http://feeds.bbci.co.uk/news/rss.xml?edition=uk | grep '<description>' | cut -f3 -d "[" | cut -f1 -d "]" | head -6 | tail -5 | awk 'NR == 1 {print ""}; sub(/^/, " "); {print ""}'
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alternatively, have five news stories and no title with this:
curl -s http://feeds.bbci.co.uk/news/rss.xml?edition=uk | grep '<description>' | cut -f3 -d "[" | cut -f1 -d "]" | head -6 | tail -5