You are viewing a single comment's thread.

view the rest of the comments →

[–] sakuramboo 0 points 5 points (+5|-0) ago  (edited ago)

Something like this...


LINKS=$(curl -s | grep class=\"comments | awk '{print $2}' | cut -d'"' -f2)
DATE=$(date +%Y-%m-%d-%H:%m)

if [ -e $BACKUP ]; then
     mkdir $BACKUP

for i in ${LINKS}; do
     FILENAME=$(echo "${i}" | cut -d"/" -f3)
     curl -o ${BACKUP}/${FILENAME} ${BASE}/${i}

tar czf voat.${DATE}.tar.gz $BACKUP

Off the top of my head, so there's probably some errors. Toss it in cron to run every 10 minutes or so, so it gets the front page of /v/all.

But, you would need to manually clean up old backups. That could be added to the script, too.

EDIT: Also, this is just to archive the front page, it doesn't check for changes, that would be manual, though could be scripted, too. It could probably be made even simpler by just looking for voat links and saving them without actually downloading the posts, if all you care about are disappearing posts.