summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--odin/strm/rss_staggered13
1 files changed, 11 insertions, 2 deletions
diff --git a/odin/strm/rss_staggered b/odin/strm/rss_staggered
index 54bbd1a3..c5198a25 100644
--- a/odin/strm/rss_staggered
+++ b/odin/strm/rss_staggered
@@ -7,8 +7,13 @@ staggerFile=~/.rss-stagger
7 7
8[[ "${FLOCKER}" != "$0" ]] && exec env FLOCKER="$0" flock -x "${staggerFile}" "$0" "$@" || : 8[[ "${FLOCKER}" != "$0" ]] && exec env FLOCKER="$0" flock -x "${staggerFile}" "$0" "$@" || :
9 9
10feeds=$(@rss2email@/bin/r2e list | awk -F ':' 'END { print $1; }') 10typeset -A feeds
11max=$(($feeds + 1)) 11r2e list | while read num junk name junk; do
12 num=${num%:}
13 feeds[${num}]=${name}
14done
15
16max=$(($#feeds))
12num=$(((max * delta_t) / interval)) 17num=$(((max * delta_t) / interval))
13[[ $num -lt 1 ]] && num=1 18[[ $num -lt 1 ]] && num=1
14 19
@@ -17,6 +22,7 @@ now=$((now % max))
17 22
18typeset -a run 23typeset -a run
19run=() 24run=()
25
20typeset -a names 26typeset -a names
21names=() 27names=()
22 28
@@ -25,8 +31,11 @@ n=0
25for i in $(seq $((now + 1)) $((now + num + 1))); do 31for i in $(seq $((now + 1)) $((now + num + 1))); do
26 n=$((i % max)) 32 n=$((i % max))
27 run+=$n 33 run+=$n
34 names+=$feeds[${n}]
28done 35done
29 36
30echo $n >! ${staggerFile} 37echo $n >! ${staggerFile}
31 38
39print ${names}
40
32exec @rss2email@/bin/r2e run $run 41exec @rss2email@/bin/r2e run $run