process fetched sfeeds with mblaze

This commit is contained in:
Felix Van der Jeugt 2020-12-13 00:38:48 +01:00
parent d11b585ecb
commit bd70c1247c
No known key found for this signature in database
GPG Key ID: 58B209295023754D
3 changed files with 17 additions and 33 deletions

View File

@ -4,6 +4,17 @@ mlist /data/mail/outbox | mpick -t 'from =~ "posteo"' | mflag -F | mrefile /data
mlist /data/mail/outbox | mpick -t 'from =~ "ugent"' | mflag -F | mrefile /data/mail/ugent/Sent
mlist /data/mail/outbox | mpick -t 'from =~ "gmail"' | mflag -F | mrefile /data/mail/gmail/Sent
# Find new messages in feeds
d="$(mktemp -d)"
mmkdir "$d"
sfeed_update
sfeed_mbox ~/.sfeed/feeds/* | mdeliver -M -v "$d" | while read mail; do
if ! mlist /data/mail/feeds | magrep -q message-id:"$(mshow -qh message-id "$mail" | cut -d' ' -f2)"; then
mdeliver /data/mail/feeds < "$mail"
fi
done
rm -rf "$d"
# Sync email
mbsync -a
@ -12,8 +23,6 @@ if ! mdirs /data/mail | mlist -N | grep -q .; then
exit
fi
set -e
# Incorporate new mails and store them in the temp sequence
minc $(mdirs /data/mail) | mflag -F | mseq -S
@ -38,7 +47,7 @@ minc $(mdirs /data/mail) | mflag -F | mseq -S
for muted in $(cat ~/.mblaze/muted); do
mpick -t '"references" =~~ "'"$muted"'"'
done
} | sort | uniq | marchive
} | sort | uniq | mflag -Sf
# Clear muted sequence
#mseq -f < ~/.mblaze/muted | mpick -t 'date < "'"$(date -I -d '1 month ago')"'"' | sponge ~/.mblaze/muted

View File

@ -1,25 +0,0 @@
set unmatched-mail keep
account "sfeed" mbox "%[home]/.sfeed/feeds.mbox"
$cachepath = "%[home]/.sfeed/feeds.mbox.cache"
cache "${cachepath}"
$feedsdir = "/data/mail/feeds/"
# check if in cache by message-id.
match case "^Message-ID: (.*)" in headers
action {
tag "msgid" value "%1"
}
continue
# if in cache, stop.
match matched and in-cache "${cachepath}" key "%[msgid]"
action {
keep
}
# not in cache, process it and add to cache.
match all action {
maildir "${feedsdir}"
add-to-cache "${cachepath}" key "%[msgid]"
keep
}

View File

@ -2,14 +2,14 @@ feeds() {
# feed <name> <feedurl> [basesiteurl] [encoding]
# get youtube Atom feed: curl -s -L 'https://www.youtube.com/user/gocoding/videos' | sfeed_web | cut -f 1
feed "Giant in the Playground" "http://www.giantitp.com/comics/oots.rss"
feed "Giant in the Playground" "https://www.giantitp.com/comics/oots.rss"
feed "XKCD" "https://xkcd.com/atom.xml" "https://xkcd.com"
feed "Ulyssis" "https://ulyssis.org/feed/"
feed "Schneier on Security" "https://www.schneier.com/blog/atom.xml"
feed "Schneier on Security" "https://www.schneier.com/feed/atom/"
feed "PHD Comics" "https://phdcomics.com/gradfeed.php" "https://www.phdcomics.com"
feed "Void news" "https://voidlinux.org/atom.xml" "https://voidlinux.org"
feed "Uniprot" "https://www.uniprot.org/news/?format=rss"
feed "qutebrowser" "http://blog.qutebrowser.org/feeds/all.rss.xml"
feed "qutebrowser" "https://blog.qutebrowser.org/feeds/all.rss.xml"
feed "This week in Rust" "https://this-week-in-rust.org/rss.xml"
feed "Saturday Morning Breakfast Cereal" "https://www.smbc-comics.com/comic/rss"
feed "Minute Physics" "https://www.youtube.com/feeds/videos.xml?channel_id=UCUHW94eEFW7hkUMVaZz4eDg"
@ -24,7 +24,7 @@ feeds() {
feed "Leah Neukirchen" "https://leahneukirchen.org/blog/index.atom"
feed "Infogroep" "https://infogroep.be/feed.xml"
feed "Zeus" "https://zeus.ugent.be/feed.xml"
feed "FOSDEM" "https://fosdem.org/2020/rss.xml"
feed "Iris" "https://irisgent.be/atom.xml"
feed "FOSDEM" "https://fosdem.org/2021/rss.xml"
feed "BE-Alert" "https://www.be-alert.be/nl/rss.xml"
feed "Martanne" "https://www.brain-dump.org/blog/index.xml"
}