#!/usr/bin/env zsh
-set -e
+setopt ERR_EXIT EXTENDED_GLOB
cmds=$0:h:a
. $cmds/env.rc
-setopt EXTENDED_GLOB
[[ -s $1/max ]] && max=`cat $1/max` || max=$FEEDER_MAX_ITEMS
(( max++ ))
[[ $max -eq 1 ]] || rm -fv $1/cur/*(Nom[$max,-1])
#!/usr/bin/env zsh
-set -e
+setopt ERR_EXIT
cmds=$0:h:a
. $cmds/env.rc
log=$1.log
#!/usr/bin/env zsh
-set -e
+setopt ERR_EXIT EXTENDED_GLOB
cmds=$0:h:a
. $cmds/env.rc
fpath=($cmds/functions.zsh $fpath)
dst=$2:a
cd $1
-[[ -n "$dst" ]] || { dst=encs ; dst=$dst:a }
+[[ -n $dst ]] || { dst=encs ; dst=$dst:a }
mkdir -p $dst
autoload url-to-filename
zmodload -F zsh/datetime b:strftime
-setopt EXTENDED_GLOB
for new (new/*(N)) {
while read line ; do
- [[ "$line" != "" ]] || break
+ [[ -n $line ]] || break
cols=(${(s: :)line})
[[ $cols[1] = "X-Enclosure:" ]] || continue
url=$cols[2]
- [[ -n "$url" ]]
+ [[ -n $url ]]
fn=$(strftime %Y%m%d-%H%M%S)-$(url-to-filename $url)
${=WGET} --user-agent=$FEEDER_USER_AGENT \
--output-document=$dst/$fn $url 2>&2 2>encs.log
#!/usr/bin/env zsh
-set -e
+setopt ERR_EXIT EXTENDED_GLOB
cmds=$0:h:a
. $cmds/env.rc
fpath=($cmds/functions.zsh $fpath)
dst=$2:a
cd $1
-[[ -n "$dst" ]] || { dst=warcs ; dst=$dst:a }
+[[ -n $dst ]] || { dst=warcs ; dst=$dst:a }
mkdir -p $dst
autoload url-to-filename
zmodload -F zsh/datetime b:strftime
-setopt EXTENDED_GLOB
wget_opts=(
--user-agent="$FEEDER_USER_AGENT"
--page-requisites
)
for new (new/*(N)) {
while read line ; do
- [[ "$line" != "" ]] || break
+ [[ -n $line ]] || break
cols=(${(s: :)line})
[[ $cols[1] = "X-URL:" ]] || continue
url=$cols[2]
#!/usr/bin/env zsh
-set -e
-setopt EXTENDED_GLOB
+setopt ERR_EXIT EXTENDED_GLOB
for i (**/new) {
pushd $i
for m (*(N)) mv -v $m ../cur/"$m":2,S
#!/usr/bin/env zsh
-set -e
+setopt ERR_EXIT
cmds=$0:h:a/cmd
for f (feeds/*) $cmds/clear $f
#!/usr/bin/env zsh
-set -e
-setopt EXTENDED_GLOB
+setopt ERR_EXIT EXTENDED_GLOB
for f (feeds/*(/on)) {
news=($f/new/*(N))
[[ $#news -eq 0 ]] || print "$f:t": $#news
#!/usr/bin/env zsh
-set -e
+setopt ERR_EXIT
fpath=($0:h:a/cmd/functions.zsh $fpath)
autoload url-to-filename
typeset -A seen
seen[$dir]=1
[[ -e $dir ]] && continue || :
mkdir -p $dir/{cur,new,tmp} # make it maildir
- echo "$url" > $dir/url
+ print -- "$url" > $dir/url
print $dir
done
for dir (feeds/*) [[ $seen[$dir] -eq 1 ]] || print disappeared: $dir