sfeed_sendmail

sfeed to sendmail command
git clone git://r-36.net/sfeed_sendmail
Log | Files | Refs | LICENSE

sfeed-run (517B)


      1 #!/bin/sh
      2 
      3 export PATH="$HOME/bin:$PATH"
      4 
      5 sfeedrc="$HOME/.sfeed/sfeedrc"
      6 toaddr="rss@r-36.net"
      7 
      8 sfeed_update "${sfeedrc}" 2>&1 | grep FAIL
      9 eval $(grep ^sfeedpath= "${sfeedrc}")
     10 cd $sfeedpath
     11 find . -type f -not -name '*.new' -not -name "*.old" \
     12 | while read -r filen;
     13 do
     14 	[ ! -f ${filen}.old ] && touch ${filen}.old
     15 	cat ${filen} ${filen}.old | sort | uniq -u > ${filen}.new
     16 	if [ $(stat -c %s "${filen}.new") -gt 0 ];
     17 	then
     18 		cat ${filen}.new | sfeed_sendmail "${toaddr}" "${filen}"
     19 	fi
     20 	cp $filen $filen.old
     21 done
     22