all repos — zenUtils @ main

misc utilities for computing zen

podlist.sh (raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

# Derek Stevens <nilix@nilfm.cc>
# MIT license

# export PODLIST_DATA_DIR=/wherever/you/want in your shell startup
# and keep a .feeds file in it where each line looks like:
# podcast_name https://domain.com/path/to/rss/feed

while read l; do
  set -- ${l}
  tmpfile=$(mktemp)
  wget -O ${tmpfile} $2
  xmllint --xpath '/rss/channel/item/enclosure/@url' ${tmpfile} | sed -e 's/url=//g' -e 's/"//g' > ${PODLIST_DATA_DIR:-~}/${1}.m3u
  rm ${tmpfile}
done < ${PODLIST_DATA_DIR:-~}/.feeds