#!/bin/bash HOST="http://pms.uberzach.com:32400" CURL_OPTS=(--silent --connect-timeout 5 --max-time 30) NUM_SERIES=18 NUM_EPISODES=4 MAX_RESULTS=100 # Select a configuration mode URL1="${HOST}/library/sections/2/onDeck/" URL2_POST="children/allLeaves?unwatched=1" if echo "${1}" | grep -iq Movie; then URL1="${HOST}/library/sections/1/recentlyAdded/" URL2_POST="" elif echo "${1}" | grep -iq YouTube; then URL1="${HOST}/library/sections/16/onDeck/" NUM_EPISODES=$(( $NUM_EPISODES * 3 )) NUM_SERIES=$(( $NUM_SERIES * 2 )) fi # Find recent items ITEMS="`curl ${CURL_OPTS[@]} "${URL1}" | \ grep '