#!/bin/bash if [[ ${cfg[template]} == 'default' ]]; then source templates/head.sh fi declare -A strings if session_verify "${cookies[sh_session]}"; then while read i; do IFS=':' y=($i) IFS=$'\n' data=$(curl -s "https://www.youtube.com/feeds/videos.xml?channel_id=${y[1]}"); video_id+=($(grep "" <<< "$data" | sed -E 's/[//g')) video_date+=($(grep "" <<< "$data" | tail -n 15 | sed -E 's/[ //g;s/T/\\ /;s/\+.*//' | xargs -L1 date "+%s" -d)) video_uploader+=($(grep -Poh "name>.*?//;s/<\///' | head -n 1)) done <<< "$(cat storage/subscribed | grep -P "^$(session_get_username ${cookies[sh_session]}):")" queue=$(for (( i=0; i<${#video_id[@]}; i++ )); do echo "$i ${video_date[i]}"; done | sort -k2r | awk '{print $1}') while read i; do strings[feed]+="
${video_title[$i]}
$(date -d "@${video_date[$i]}" "+%H:%M, %d %h %Y")
" done <<< "$queue" else strings[feed]="You're not logged in!" fi source "${cfg[namespace]}/templates/header.shs" render_unsafe strings "${cfg[namespace]}/templates/themes/${cfg[template]}/feed.t"