Skip to content

Instantly share code, notes, and snippets.

@cirrusUK
Created October 27, 2014 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cirrusUK/5fd7e15ce430144e2cbe to your computer and use it in GitHub Desktop.
Save cirrusUK/5fd7e15ce430144e2cbe to your computer and use it in GitHub Desktop.
#!/bin/sh
URL="http://feeds.bbci.co.uk/news/uk/rss.xml"
curl --silent "$URL" | grep -E '(title>|description>)' | \
grep -E '(<title>|description)' | tail -n +4 | sed -e 's/<!\[CDATA\[//g' -e 's/\]\]>//g' | sed -e 's/<a.*a>/ /g' | sed -e 's/<*.title>//g' -e 's/&lt;.*/\
/' | sed -e 's/<*.title>//g' -e 's/&lt;.*/\
/' | sed -e '/<description>/d' | sed -e 's/<\/description>/\
/g
' | fmt -w 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment