#!/bin/bash # apt install git toot wget # toot login # Just the first time peertubeNode="fediverse.tv" apiUrlLastVideos="https://$peertubeNode/api/v1/videos" tmpFile="/tmp/.lastChannelsPeertube" function main { getLastChannelsAccountsWithActivity createTootMsg } function getLastChannelsAccountsWithActivity { wget -q "$apiUrlLastVideos" -O - | tr "\"" "\n" | grep -i "https://$peertubeNode/video-channels" | cut -d "/" -f 5 | sort -u > $tmpFile readarray -t channel < $tmpFile && > $tmpFile for a in "${channel[@]}"; do echo "@$a@$peertubeNode" >> $tmpFile; done readarray -t channel < $tmpFile } function createTootMsg { tootMsg="Cuentas recomendadas para seguir ${channel[@]}. Cuentas con contenido multimedia que han tenido actividad en las Ășltimas 24horas #fediverse #fediverso #video #peertube #canales #channels" toot post "$tootMsg" } main