ref: 62b0682919ca0b7842faa3c60a8127f70c0a6996
parent: cad4dfffe0f6a96225ba9b930e45412bcdc73d3d
author: sl <sl@x1yg3>
date: Sun Jul 6 19:09:48 EDT 2025
add rrss.barf
--- a/INDEX
+++ b/INDEX
@@ -52,6 +52,7 @@
pss - Spot check for accumulating processes.
r - setup environment and run rio.
rag - save image under http://notreally.info/transport/spacecraft/ragnarok/img/
+rrss.barf - Dump RSS feeds into werc/apps/barf entries.
sparkline - create a sparkline (by anth)
t - run whichever torrent program is preferred on unix or 9front.
tablet - launch aux/tablet and aux/wacom
--- /dev/null
+++ b/rrss.barf
@@ -1,0 +1,47 @@
+#!/bin/rc
+# 2024-08-27T22:47:32-04:00
+# Dump RSS feeds into werc/apps/barf entries.
+# Run from cron.
+rfork en
+name=$1
+if(! ~ $name read tumblr){
+ echo guess again. >[1=2]
+ exit usage
+}
+log=/sys/log/$name.err
+root=/usr/sl/www/werc/sites/$name.stanleylieber.com
+urls=/usr/sl/lib/$name
+bind -c /sys/log/read.links $root/links
+>$log
+{
+ while(){
+ sleep 30
+ if(ps | grep -s -e 'Broken[ ]+rrss'){
+ {date; echo Kill Broken rrss} >>$log
+ Kill rrss | rc
+ }
+ sleep 30
+ if(ps | grep -s -e 'Sleep[ ]+rrss'){
+ {date; echo Kill Sleep rrss} >>$log
+ Kill rrss | rc
+ }
+ }
+} &
+ofs=$ifs
+ifs='
+' {
+ for(i in `{cat $urls}){
+ ifs=$ofs {
+ j=`{echo $i}
+ url=$j(1)
+ tag=$j(2-)
+ }
+ echo $"url $"tag >>$log
+ alarm 30 rrss -f barf -r $root -t $"tag -u $"url >>[2]$log ||
+ echo $"url FAIL >>$log
+ }
+}
+for(i in `{walk $root/src}){ chgrp www $i }
+echo ',s/^$\n//g; w; q' | sam -d $root/links
+{date; echo Kill rrss.barf} >>$log
+Kill rrss.barf | rc
--
⑨