-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate-our-fair-city.sh
executable file
·41 lines (27 loc) · 1.02 KB
/
update-our-fair-city.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
URL_RSS="https://ourfaircity.libsyn.com/rss"
PRETTY_NAME="Our Fair City"
GOOD_REGEX="^[eE]pisode [0-9]+.[0-9]+"
# DEBUG=TRUE
# JUST_TEST=TRUE
# NO_SLACK=TRUE
# NO_UPDATE_SYNCTHING=TRUE
# NO_UPDATE_REMOTE=TRUE
source $HOME/GIT/podcast-scripts/update-podcasts-common.sh
WriteFeed
for ITEM in $(seq 1 ${ITEM_COUNT}) ; do
eval $(GetItem ${ITEM})
if [[ "${RAW_TITLE}" =~ ${GOOD_REGEX} ]] ; then
[ ${DEBUG} ] && echo "PASS regex: \"${RAW_TITLE}\""
# eval $(echo "${RAW_TITLE}" | sed 's/.*- \(.*\)/TITLE="\1"/')
# TITLE=$(echo "${RAW_TITLE}" | sed 's/[eE]pisode [0-9]\+\.[0-9]\+ \(.*\)/\1/ ; s/- \(.*\)/\1/')
eval $(echo "${RAW_TITLE}" | sed 's/[eE]pisode [0-9]\+\.[0-9]\+[ -:]\{0,1\}[ -:]\{0,1\} \(.*\)/TITLE="\1"/')
[ ${#SEASON} -eq 1 ] && SEASON="0${SEASON}"
[ ${#TRACK} -eq 1 ] && TRACK="0${TRACK}"
TRACK="${SEASON}${TRACK}"
DisectInfo "${PUBDATE}" "${EPURL}" "${TITLE}" "${TRACK}"
UnsetThese
else
[ ${DEBUG} ] && echo "FAIL regex: \"$TYPE\" - \"${RAW_TITLE}\""
fi
done