[bin] Updating nyt download script

This commit is contained in:
2024-11-19 11:56:27 -05:00
parent 80ae8c208e
commit 4371a8a72d

View File

@ -1,5 +1,5 @@
#!/bin/bash
BASEDIR="/media/photos/nyt"
BASEDIR="/media/photos/misc/nytimes"
DATE=$(date +"%Y-%m-%d")
TMPFILE=/tmp/nyt.pdf
OUTFILE=$BASEDIR/$DATE.jpg
@ -11,6 +11,7 @@ else
curl -o /tmp/nyt.pdf -L https://static01.nyt.com/images/$DATEPATH/nytfrontpage/scan.pdf
convert -density 150 -quality 75 $TMPFILE $OUTFILE
ln -sf $OUTFILE /var/lib/weewx/www/today.jpg
curl -H "X-Title: NYT headlines today" -d "https://wx.lab.unbl.ink/today.jpg" https://ntfy.unbl.ink/news
ln -sf $OUTFILE $BASEDIR/today.jpg
curl -H "X-Title: NYT headlines today" -d "https://files.lab.unbl.ink/nytimes/today.jpg" https://ntfy.unbl.ink/news
rm $TMPFILE
fi