You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
870 B
Bash
27 lines
870 B
Bash
#!/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
|