el bot que añadir a cron

master
fanta 1 year ago
parent 3c2c38fd8e
commit 8ad46b2030

@ -0,0 +1,26 @@
#!/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
Loading…
Cancel
Save