Skip to content

Instantly share code, notes, and snippets.

@cite
Created September 29, 2013 10:24
Show Gist options
  • Save cite/6751245 to your computer and use it in GitHub Desktop.
Save cite/6751245 to your computer and use it in GitHub Desktop.
Parse RSS feed with xmlstarlet
#/bin/bash
entrydir=/tmp/rss-entries
xmlstarlet sel -t -m "//item/title" -v . -n $1 | while read title; do
entryhash=$(echo $title | md5sum | awk '{print $1}')
xmlstarlet sel -t -m "//item[title='$title']" -c . $1 > $entrydir/$entryhash
done
@pabloab
Copy link

pabloab commented Dec 31, 2019

failed to load external entity "https://feeds.feedburner.com/TEDenEspanol"

Maybe this help as an inspiration to do this with one line:

curl -s http://www.mininova.org/rss/ubuntu | xmlstarlet sel -N atom="http://www.w3.org/2005/Atom" -t -m './/enclosure' -v '@url' -n | wget -i -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment