Non-official site for The Life Series Minecraft hardcore survival multiplayer series housing every video www.life-series.online
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

script naming update

Ghustvn 60c9d355 3754301d

+27 -26
+4 -4
scripts/append_video.sh
··· 1 1 #!/usr/bin/env bash 2 2 3 - member=$1 4 - video_id=$2 5 - video_title=$3 3 + channelName=$1 4 + id=$2 5 + title=$3 6 6 7 - cat ./src/data/seasons.json | echo $(jq ".[0].videos[\"${member}\"] += [{ "id": \"${video_id}\", "title": \"${video_title}\" }]") > ./src/data/seasons.json 7 + cat ./src/data/seasons.json | echo $(jq ".[0].videos[\"${channelName}\"] += [{ "id": \"${id}\", "title": \"${title}\" }]") > ./src/data/seasons.json
+23 -22
scripts/get_latest_videos.sh
··· 1 1 #!/usr/bin/env bash 2 2 3 - declare -A playlist0=([member]='BdoubleO100' [playlistId]='UUlu2e7S8atp6tG2galK9hgg') 4 - declare -A playlist1=([member]='BigB' [playlistId]='UU_msGd9XFp8kggtOQu6uARg') 5 - declare -A playlist2=([member]='Etho' [playlistId]='UUFKDEp9si4RmHFWJW1vYsMA') 6 - declare -A playlist3=([member]='GeminiTay' [playlistId]='UUUBsjvdHcwZd3ztdY1Zadcw') 7 - declare -A playlist4=([member]='GoodTimesWithScar' [playlistId]='UUodkNmk9oWRTIYZdr_HuSlg') 8 - declare -A playlist5=([member]='Grian' [playlistId]='UUR9Gcq0CMm6YgTzsDxAxjOQ') 9 - declare -A playlist6=([member]='Impulse' [playlistId]='UUuMJPFqazQI4SofSFEd-5zA') 10 - declare -A playlist7=([member]='InTheLittleWood' [playlistId]='UUTSu4x8ahsJ16T9fWiwlKdg') 11 - declare -A playlist8=([member]='LDShadowLady' [playlistId]='UUzTlXb7ivVzuFlugVCv3Kvg') 12 - declare -A playlist9=([member]='Mumbo' [playlistId]='UUhFur_NwVSbUozOcF_F2kMg') 13 - declare -A playlist10=([member]='PearlescentMoon' [playlistId]='UU1GJ5aeqpEWklMBQ3oXrPQQ') 14 - declare -A playlist11=([member]='Rendog' [playlistId]='UUDpdtiUfcdUCzokpRWORRqA') 15 - declare -A playlist12=([member]='Skizzleman' [playlistId]='UUYdXHOv7srjm-ZsNsTcwbBw') 16 - declare -A playlist13=([member]='Smajor1995' [playlistId]='UUxucf8O8itcmkqu3d7yUavg') 17 - declare -A playlist14=([member]='SmallishBeans' [playlistId]='UU4qdHN4zHhd4VvNy3zNgXPA') 18 - declare -A playlist15=([member]='Solidarity' [playlistId]='UU6XAct-Bus4x3mYz3VC_HUw') 19 - declare -A playlist16=([member]='Tango' [playlistId]='UU4YUKOBld2PoOLzk0YZ80lw') 20 - declare -A playlist17=([member]='ZombieCleo' [playlistId]='UUjI5qxhtyv3srhWr60HemRw') 3 + declare -A channel0=([channelName]='BdoubleO100' [channelId]='UUlu2e7S8atp6tG2galK9hgg') 4 + declare -A channel1=([channelName]='BigB' [channelId]='UU_msGd9XFp8kggtOQu6uARg') 5 + declare -A channel2=([channelName]='Etho' [channelId]='UUFKDEp9si4RmHFWJW1vYsMA') 6 + declare -A channel3=([channelName]='GeminiTay' [channelId]='UUUBsjvdHcwZd3ztdY1Zadcw') 7 + declare -A channel4=([channelName]='GoodTimesWithScar' [channelId]='UUodkNmk9oWRTIYZdr_HuSlg') 8 + declare -A channel5=([channelName]='Grian' [channelId]='UUR9Gcq0CMm6YgTzsDxAxjOQ') 9 + declare -A channel6=([channelName]='Impulse' [channelId]='UUuMJPFqazQI4SofSFEd-5zA') 10 + declare -A channel7=([channelName]='InTheLittleWood' [channelId]='UUTSu4x8ahsJ16T9fWiwlKdg') 11 + declare -A channel8=([channelName]='LDShadowLady' [channelId]='UUzTlXb7ivVzuFlugVCv3Kvg') 12 + declare -A channel9=([channelName]='Mumbo' [channelId]='UUhFur_NwVSbUozOcF_F2kMg') 13 + declare -A channel10=([channelName]='PearlescentMoon' [channelId]='UU1GJ5aeqpEWklMBQ3oXrPQQ') 14 + declare -A channel11=([channelName]='Rendog' [channelId]='UUDpdtiUfcdUCzokpRWORRqA') 15 + declare -A channel12=([channelName]='Skizzleman' [channelId]='UUYdXHOv7srjm-ZsNsTcwbBw') 16 + declare -A channel13=([channelName]='Smajor1995' [channelId]='UUxucf8O8itcmkqu3d7yUavg') 17 + declare -A channel14=([channelName]='SmallishBeans' [channelId]='UU4qdHN4zHhd4VvNy3zNgXPA') 18 + declare -A channel15=([channelName]='Solidarity' [channelId]='UU6XAct-Bus4x3mYz3VC_HUw') 19 + declare -A channel16=([channelName]='Tango' [channelId]='UU4YUKOBld2PoOLzk0YZ80lw') 20 + declare -A channel17=([channelName]='ZombieCleo' [channelId]='UUjI5qxhtyv3srhWr60HemRw') 21 21 22 22 youtubeAPIKey="" 23 23 24 24 > latest_videos 25 25 26 - declare -n playlist 27 - for playlist in ${!playlist@}; do 28 - video=$(curl -s "https://www.googleapis.com/youtube/v3/playlistItems?key=${youtubeAPIKey}&maxResults=1&part=snippet&playlistId=${playlist[playlistId]}") 26 + declare -n channel 27 + for channel in ${!channel@}; do 28 + video=$(curl -s "https://www.googleapis.com/youtube/v3/playlistItems?key=${youtubeAPIKey}&maxResults=1&part=snippet&playlistId=${channel[channelId]}") 29 29 videoId=$(echo $video | jq ".items[].snippet.resourceId.videoId") 30 30 title=$(echo $video | jq ".items[].snippet.title") 31 - echo "${playlist[member]};${videoId};${title}" >> latest_videos 31 + 32 + echo "${channel[channelName]};${videoId};${title}" >> latest_videos 32 33 done 33 34 34 35 awk -F';' '{print $1 " " $2 " " $3}' latest_videos | xargs -l ./scripts/append_video.sh